How I can increment a slot value by 1 without PyTEAL compiler yelling about store/load order?
e.g:
def verify():
verify_from = Txn.application_args[0]
verify_to = Txn.application_args[1]
bitfield = ScratchVar(TealType.uint64, SLOTID_VERIFIED_BITS)
return Seq([Assert(And(is_proper_group_size(),
Txn.group_index() < Global.group_size(),
Txn.group_index() > Int(0),
Btoi(verify_to) > Btoi(verify_from),
Txn.sender() == App.globalGet(Bytes("vphash")))),
bitfield.store(bitfield.load() + Int(1)),
Approve()])
It wont me let to do bitfield.store(bitfield.load() + 1), but this should be pretty “transpilable” to TEAL without problems. Should be noted that bitfield
is a fixed slot at position SLOTID_VERIFIED_BITS
.
Thanks in advance.