Hi everybody,
this error is caused by set of arguments I passed to Smart Contract. Actually I passed 129 arguments of total dimension 160 bytes (so less than 2048 that is the cap).
Is there a way to pass more than 16 arguments?
Or the only way is to merge some of these and then split them in Smart Contract? In this case, how can I split them in Smart Contract?
No, these are 128 integer arguments of 1 byte each and 1 string argument of 32 bytes, but before I pass them to Smart Contract, I convert all of these in bytes, in this way: args.append(bytes([data[x]])))
where args is array I pass to Smart Contract, and data is the array contains 128 integers.
Then I append to args also last string argument converting it in this way: idUtente.encode()
Which can be the solution?
Is there a way to merge the integers in one argument of 128 bytes and then split it in Smart Contract? If yes, can you show me an example of implementation?
But I have a problem in passing arguments to Smart Contract. Because, before to know the cap of 16 arguments, I did this:
for x in range(0, 64):
args.append(bytes([data[x]]))
where data is my array of 64 values and args is my array I pass to Smart Contract.
So, I no have idea how to pass all 64 integer values.
I can merge all values in one string like this: '00000000000000000000000006400000000000000000000000000000000000000'
(64 values, one 64 and sixty-three 0).
But to pass it to Smart Contract I have to convert it again in bytes and it gains a dimension of 65 bytes.
This is a problem when in Smart Contract I want to get single value 64.
Same problem of too big dimension if I merge (not integer values, but) bytes values, like this string: b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'@'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'b'\x00'
How could be a solution to pass more than 16 values and get it in Smart Contract?
Because no value is greater than 64 you should be able to pass the parameters as a bytearray and then use the Teal opcode to get each value out of the byte array and use as an integer. If you look at the opcode description that is what is does.
Hi,
thank you for your help, it works! So I can pass these values to Smart Contract.
But I have a doubt: how can I get them in Smart Contract?
I asked it because I get them through assignment like this: biometrics = Txn.application_args[0], then, to view the content in this way: