Options
All
  • Public
  • Public/Protected
  • All
Menu

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 the runtime - the latter will be updated during the context commit phase once all transactions in the groups succeed.

Hierarchy

  • Interpreter

Index

Constructors

constructor

Properties

bytecblock

bytecblock: Uint8Array[]

callStack

callStack: Stack<number>

gas

gas: number

instructionIndex

instructionIndex: number

instructions

instructions: Operator[]

intcblock

intcblock: BigInt[]

labelMap

labelMap: Map<string, number>

length

length: number

lineToCost

lineToCost: {}

Type declaration

  • [key: number]: number

runtime

runtime: Runtime

scratch

scratch: StackElem[]

Readonly stack

stack: TEALStack

tealVersion

tealVersion: number

Methods

assertValidTxArray

  • assertValidTxArray(): void

execute

getAccount

  • 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.

    Parameters

    • accountRef: StackElem

      index of account to fetch from account list

    • line: number

      line number NOTE: index 0 represents txn sender account

    Returns AccountStoreI

getApp

getAppIDByReference

  • getAppIDByReference(appRef: number, foreign: boolean, line: number, op: Op): number

getAssetDef

  • getAssetDef(assetId: number): undefined | AssetParams

getAssetIDByReference

  • getAssetIDByReference(assetRef: number, foreign: boolean, line: number, op: Op): number

getGlobalState

  • getGlobalState(appID: number, key: string | Uint8Array, line: number): undefined | StackElem

jumpForward

  • jumpForward(label: string, line: number): void

jumpToLabel

  • jumpToLabel(label: string, line: number): void

mapLabelWithIndexes

  • mapLabelWithIndexes(): void

printStack

  • printStack(instruction: Operator, debugStack?: number): void

setGlobalState

  • setGlobalState(appID: number, key: string | Uint8Array, value: StackElem, line: number): void

Generated using TypeDoc