Hello everyone. I am trying to connect a stateful and a statless smart contract. The process is as follows:
1 I create the stateful smart contract
2 I create the stateless smart contract
3 I execute an Application Call of type Update with an argument equal to the address of the stateless smart contract.
The code snippet of the Stateful is as follows:
…
handle_updateapp:
byte “Creator”
app_global_get
txn Sender
txn NumAppArgs
int 1
&&
bz failed
byte “Stateless”
txna ApplicationArgs 0
app_global_put
int 1
return
…
The way I pass the argument with Javascript is as follows:
let args = [new Uint8Array (Buffer.from (statelessAddress, “base64”))]
await updateApp (algodClient, creatorAccount, appID, approvalProgram, clearProgram, args);
The code works fine, however, when in another teal code snippet I check that a certain transaction (in an atomic transfer) is sent by the Stateless smart contract, the check always fails. In fact I noticed that in the global state, the address of the Stateless is not stored, but a slightly different string. What am I doing wrong?
Sorry for my English.
Thank you all