Question about PyTeal scratch space - General - Algorand

Question about PyTeal scratch space

post by javier0rosas on Dec 9, 2021

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.

post by fabrice on Dec 9, 2021

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.

Related topics

Topic Replies Views Activity
Sharing temporarily data between stateful and stateless contracts 1 317 Jul 2021
PyTEAL: Increment slot value in a Seq expression 3 516 Nov 2021
PyTEAL: Loop load from scratch slots 3 441 Oct 2021
Is {int,byte}cblock used multiple times? 2 431 Feb 2023
Teal and Memory Efficiency 4 524 Dec 2020