PyTEAL: Loop load from scratch slots

I’m finding problems in pyTEAL looping over scratch slots if ScratchVar(type, i) accepts int as a slot-id type but not Int. Is this possible?

# Clear slots loop

For(i.store(Int(0)), i.load() < num_slots, i.store(i.load() + Int(1))).Do(
            Seq([
                (ScratchVar(TealType.uint64, i.load())).store(Int(0))
            ]))

In pseudo this should conform to

FOR I = 0 TO NUM_SLOTS DO  
       STORE 0 -> SLOT(I)  
NEXT

This is solvable in current version?
At least is perfectly possible in TEAL5 by using looping and stores opcode.
Kind regards,

1 Like

It looks like PyTEAL does not support this yet.
That’s a very good point.
Can you open an issue on GitHub - algorand/pyteal: Algorand Smart Contracts in Python and cross-reference it with this post?

I will do. Thank you and have a nice weekend.

1 Like