Issue storing address in local storage through app arguments

I am trying to store the plaintext address NPQHUMZIMDASRNTDXTHL6M44DQM7N3U4SNHOJMQ4M2L7AO4MVJ3ZKMFZIA in a user’s local storage using app arguments:

app_args = [account_address,
            key,                  
            value,                
        ]

but I am getting the following error: logic eval error: not an address"

I am trying to use: encoding.decode_address(address), but it is still giving me the following error:

logic eval error: invalid Account reference NPQHUMZIMDASRNTDXTHL6M44DQM7N3U4SNHOJMQ4M2L7AO4MVJ3ZKMFZIA

Please help.

  • Javier

Key values are stored as either byte arrays or uint64s. So if you are using TEAL you have to use the addr pseudo opcode before storing. For example:

byte "Mykey"
addr NPQHUMZIMDASRNTDXTHL6M44DQM7N3U4SNHOJMQ4M2L7AO4MVJ3ZKMFZIA
app_global_put

In PyTeal it should look like

App.globalPut(Bytes(“MyKey”), Addr("6ZHGHH5Z5CTPCF5WCESXMGRSVK7QJETR63M3NY5FJCUYDHO57VTCMJOBGY")
)
2 Likes