Getting application arguments as ints in TEAL

Hi all,

I’m calling my application as follows

goal app call --app-arg "int:5".....

I seem to only be able to get a byteslices from invoking

txna ApplicationArgs 0

even though the argument is declared as an int in the goal call. Is there a way to retrieve the argument as an int instead of a byteslice?

Hi @xonack,

You should convert your argument using the btoi opcode. It does exactly what you want: converts bytes passed as big endian through app call arguments to uint64.

1 Like