-
Ethers Version5.7.1 Search Termsdefaultabicoder abicoder encode array arrays error throw Describe the ProblemThis produces a value:
Maybe it's a feature? But I would've expected it to throw (the type is a Code Snippetethers.utils.defaultAbiCoder.encode(['uint16'], [[1, 2]]) Contract ABINo response ErrorsNo response Environmentnode.js (v12 or newer) Environment (Other)No response |
Beta Was this translation helpful? Give feedback.
Answered by
ricmoo
Jan 18, 2023
Replies: 1 comment
-
In v5, a BigNumberish is allowed to be a big-endian array. So, it's just interpreting it that way. If you notice though, this will fail: |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
fvictorio
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In v5, a BigNumberish is allowed to be a big-endian array. So, it's just interpreting it that way.
If you notice though, this will fail:
utils.defaultAbiCoder.encode(['uint16'], [[1, 2, 3]])
, because 3 bytes is too big for a uint16. ;)