You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @ytrezq.
Thanks for the report, but in the link you posted, the most upvoted answer shows an example of a function with variable sized arrays being called using abi.encode.
The Solidity documentation also explains about non-fixed-size types and tuples:
The following non-fixed-size types exist:
bytes: dynamic sized byte sequence.
string: dynamic sized unicode string assumed to be UTF-8 encoded.
<type>[]: a variable-length array of elements of the given type.
Types can be combined to a tuple by enclosing them inside parentheses, separated by commas:
(T1,T2,...,Tn): tuple consisting of the types T1, …, Tn, n >= 0
It is possible to form tuples of tuples, arrays of tuples and so on. It is also possible to form zero-tuples (where n == 0).
Currently, if 1 has to call a Solidity function that takes a variable sized array as parameter, he/she is asked to do it off‑chain or rewrite his code so that the function he/she intend to call use fixed size arrays instead.
But 1 popular exchange which called 0x is using
external
functions taking variable‑sized arguments : they can’t be called on chain if the parameters building has to be done on‑chain.Specification
Preferably allow
abi.encode
orabi.encodewithselector
like functions to support telling an argument isn’t taking a fixed‑size array/tuple.Backwards Compatibility
This would be a language extension using an additional possible syntax and wouldn’t affect old code encoding fixed‑size arrays.
The text was updated successfully, but these errors were encountered: