Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ScratchVar

Interface around Scratch space, similar to get/put local/global state

example
const myvar = new ScratchVar(TealType.uint64);
new Seq([
myvar.store(Int(5)),
Assert(myvar.load() == new Int(5))
]);

Hierarchy

  • ScratchVar

Index

Constructors

Properties

Methods

Constructors

constructor

  • Create a new ScratchVar with an optional type.

    Parameters

    • type: TealType = ...

      (optional): The type that this variable can hold. An error will be thrown if an expression with an incompatible type is stored in this variable. Defaults to TealType.anytype.

    Returns ScratchVar

Properties

slot

slot: ScratchSlot = ...

Methods

load

storageType

store

  • Store value in Scratch Space

    Parameters

    • value: Expr

      The value to store. Must conform to this ScratchVar's type.

    Returns Expr

Generated using TypeDoc