Why have both txn.sender() and txn.asset_sender() in PyTEAL?

Why is there a need for different syntax to check sender/receiver in AssetTransferTxns vs PaymentTxn?

I’m not the only one who’s tried to debug their smart contract in PyTEAL only to realize the .sender() field is not valid. There isn’t even an error thrown when you compile with Algod Client!

  • This makes sense
  • Someone should make the .sender() field equal the .asset_sender() field for TEAL purposes.

0 voters

:man_shrugging:

They are different. The Sender is the sender of the transaction and, often, the account the assets will come from. But not for clawback. In a clawback transaction, AssetSender, is set (normally it’s zero). The Sender is the account with clawback authority. But the assets move from AssetSender to AssetReceiver.

2 Likes