abi decode value returned as [Getter]
and throws error when accessing it
#1907
Replies: 5 comments
-
A In your above example, you can see the data is an invalid address, as there are non-zero bytes in the top 12 bytes of what you are trying to interpret as an address. An ABI encoded address must have all its upper 96 bits zero. The contract seems to have a bug in it? Was it written in assembly directly? Or perhaps the contract contains an asm block that is corrupting the return memory space? |
Beta Was this translation helpful? Give feedback.
-
Not sure about the implementation details of the contract since it's not something I wrote. |
Beta Was this translation helpful? Give feedback.
-
do you have an update? |
Beta Was this translation helpful? Give feedback.
-
can you find any solution? |
Beta Was this translation helpful? Give feedback.
-
Yes, that it the entire point of that getter. It allows access to a value which would have otherwise fully crashed parsing. :) If you look at the error, it contains the entire data used, which caused the problem, which can be used, for example, with See #1894 for a code example which does exactly this. :) |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm trying to decode function data but geting an unexpected result. This ABI has two input types so the expected result is an array with two values. The result array is indeed length of 2, however the first item is returned as
[Getter]
function instead of returning the address value.Tx for reference: https://etherscan.io/tx/0x0fc8f1cb5112c4679dfcbde54306cabecedfbfd115030252b2e3d77ed7b7da8c
Etherscan is able to decode it correctly
Beta Was this translation helpful? Give feedback.
All reactions