Hey guys!
I’m trying to understand some of the PyTEAL functions better. According to the docs, the Btoi() function returns a uint64.
My question is: What would happen if one passed the bytes of a number with more than 21 digits (greater than 2^64) to Btoi? Would the transaction be automatically rejected because of this operation?
Here’s my sample code
# send_tx.py
# assume params/addresses/amt/key have been declared already
note = '12345678909876543210321'.encode()
PaymentTxn(address1, params, address3, amt, note=note).sign(key)
This signed txn is now paired with another txn signed by logic signed by address2. The PyTEAL logic is
def teal_prog():
core = And(
Global.group_size() == Int(2),
Gtxn[0].type_enum() == TxnType.Payment,
Gtxn[0].sender() == address1,
Gtxn[0].receiver() == Gtxn[1].receiver(),
Gtxn[1].type_enum() == TxnType.Payment,
Gtxn[1].amount() == Btoi(Gtxn[0].note()) % 100000,
)
return core
( address1 uses the note field to tell address2 how many algos they owe. For whatever reason, address1 didn’t realize their note field was so long! Luckily, address2 set a limit of 99999 microalgos )
What happens when address1 submits the two PaymentTxns (after signing with the LogicSig)?
