I have a stateful smart contract that stores the address of a logic account and then compares it to the sender of a transaction. However, the equality check always fails, even when I configure the addresses to match. Here’s the snippet from the smart contract where I make the check,
byte "ADDRESS"
app_global_get
gtxn 1 Sender
==
To debug, I’ve stored the value of the Sender field of the txn into a global variable (I know, there are probably better ways to debug), and here’s the global variable printout for the app,
The issue is that one is a base32 string ("ADDRESS"), while the other is the actual 32 bytes of the address without the checksum ("SENDER", which is the proper way of encoding the address).
Most likely the issue is that you stored the address as follows:
How can I get the smart contract to treat the argument as an addr? (Tried prefixing the string representation of the address with “addr:”, but the application still treated the argument as a string.)