When using the MultiversX SDK, I can pass a list of typed values as a single Input argument to a smart contract deploy, with the method List.fromItems(arrayTypedValue)
.
How can I encode the same List
input when deploying through the mxpy
CLI?
Something like mxpy contract deploy ... --arguments <List>
.
How do I encode the <List>
here?
You need to serialize each variable in the array (according to this documentation) and then send them as a continuous string preceded by
0x
which should mark it as an encoded string. For example, the array[1, 1]
becomes0x0000000100000001
which has 3 parts:0x
00000001
00000001