Question about PyTeal scratch space

Correct me if I am wrong, but the scratch space is only useful if we want to store/load variables during runtime that I intend on using more than once, correct? If I am only using that variable once, then it makes no sense to store it in scratch space.

Yes.

It is also used to communicate between transactions.
The first transaction can write in its scratch pad and the second transaction can read it using gload/gloads.

1 Like