#Why is it that I can pass (asset) as an argument to a method, but I can't return an Asset object?

6 messages · Page 1 of 1 (latest)

serene mauve
#

not an ARC4 type or native equivalent: tuple<arc4.static_array<arc4.uint8, 32>,asset>

winged panther
#

the ARC4 spec allows passing assets as arguments see here, assets specified as arguments are also required be part of the foreign array (along with other reference types such as Account or Application)

GitHub

Algorand Requests for Comments. Contribute to algorandfoundation/ARCs development by creating an account on GitHub.

#

however they aren't allowed as return values as all foriegn arrays relate to inputs not outputs

#

instead you have to return the underlying identifier e.g. uint64 for Asset/App, address for Account

rancid marlin
#

I thought the 'assets in foreign array' stuff was dropped. I def wouldn't expect that these days.

winged panther
#

what do you mean? Still need assets either in the foreign array or "available" through some other means to do anything with them