Scratch Space - Algorand Specifications

Keyboard shortcuts

Press ← or β†’ to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Algorand Specifications

In addition to the Stack, the AVM has a Scratch Space (or heap) of 256256 positions.

Like Stack values, scratch locations may hold stackValues (of either uint64 or bytes types) and are initialized as zeroed-out uint64 values.

The Scratch Space is an additional area of volatile memory used at runtime. It’s useful for storing values needed multiple times during program execution, or that stay the same for long periods. It provides a convenient place to keep such persistent or reusable data during the program execution.

Important

IMPLEMENTATION:

Scratch Space reference implementation.

Scratch Space locations are mapped to 00-based integer index.

The Scratch Space is accessed by the load(s) and store(s) opcodes which move data respectively:

Application calls MAY inspect the final Scratch Space of earlier application call transactions in the same group using gload(s')(s), where: