This function executes TEAL code after parsing
: execution mode of TEAL code (Stateless or Stateful)
: runtime object
This function executes TEAL code after parsing and returns the result of the program.
: execution mode of TEAL code (smart signature or contract)
: runtime object
The final result on the stack or undefined if nothing was on the stack. NOTE: program should fail if there is no result (stack is empty after the execution) or the result is zero.
Queries account by accountIndex or ctx.tx.snd
(if accountIndex==0
).
If account address is passed, then queries account by address.
Throws exception if account is not found.
index of account to fetch from account list
line number NOTE: index 0 represents txn sender account
Queries app (SSCAttributesM) from state. Throws TEAL.APP_NOT_FOUND if app is not found.
Application Index
Queries appIndex by app reference (offset to foreignApps array OR index directly)
an offset to foreign app array OR appID
for older teal versions(<= 3), foreign bool represent if ref is treated as an offset/appIndex
Queries ASA Definitions data by assetID. Returns undefined if ASA is not deployed.
Asset Index
Queries assetIndex by asset reference (offset to foreignAssets array OR index directly)
an offset to foreign assets array OR assetID
for older teal versions(<= 3), foreign bool represent if ref is treated as an offset/assetIndex
Queries application by application index. Returns undefined if app is not found.
Description: moves instruction index to "label", throws error if label not found
Description: moves instruction index to "label", throws error if label not found
Maps labels with indexes according to instructions array
logs TEALStack upto depth = debugStack to console
interpreter opcode instance
max no. of elements to print from top of stack
Updates app global state. Throws error if app is not found.
Generated using TypeDoc
Interpreter parses and executes a TEAL code. Each transaction is using a new instance of interpreter and doesn't share the interpreter state. When executing the transaction we create a Context (
ctx
) and pass it to the interpreter. It encapsulates runtime state and the transaction group state (eg shared scratch space). Interpreter must not modify theruntime
- the latter will be updated during the context commit phase once all transactions in the groups succeed.