Is it possible to use an array type instead of a tuple with static-length arrays? #116
Replies: 1 comment 2 replies
-
I think that the design decision to convert to tuples for fixed size arrays makes total sense here but if you want to change the way that those types infer to fixed size tuples from fixed sized solidity arrays you will need to reconfigure the types manually. Here is a example of what I mean on this TSPlayground. This however won't work if you are using wagmi's We could possibly create a config for this type of situation but I think that it would lead to incorrect inference if we were to support it. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This question I guess also extends to Wagmi given this struct is used as a function parameter.
I have a struct defined as such in my contract, with
MAX_TOKENS
as a constant:I am grabbing the type of the DepositArgs as follows:
However, the code I have written for my utility functions uses
bigint[]
. Is there a good way to continue interfacing with Wagmi, and abi-extracted types with arrays instead of tuples? It seems like some additional boilerplate is needed if, for instance, large arrays were used in the solidity code. Or is this considering undesirable as then the length of the arrays won't be compile-time checked?Beta Was this translation helpful? Give feedback.
All reactions