PyTeal - Logicsig - General - Algorand
PyTeal - Logicsig
post by SethDev on Feb 8, 2022
I was playing around with Pyteal and I thought about this…
program = And(
Txn.type_enum() == TxnType.Payment,
Txn.fee() <= Int(1000),
Txn.amount() >= Int(1000),
Txn.sender() == Addr(),
Global.group_size() == Int(1),
Txn.rekey_to() == Global.zero_address()
)
I want to declare the Txn.sender() to be the contract address. How do I specify that condition?
post by Ben on Feb 8, 2022
Txn.sender() is implicitly the contract address since it can't be anything else.
post by SethDev on Feb 8, 2022
But I can specify the sender to another address like so:
Txn.sender() == "address" and only that address passed will be the sender else the contract fails. So do you mean if I don’t specify, the Txn.sender() will be the contract address. Am I right?
post by Ben on Feb 8, 2022
In TEAL the Txn is the transaction currently being evaluated. The sender will always* be the contract address
*except in the case of a rekey
post by SethDev on Feb 8, 2022
I understand now, Thank you Ben!