I am developing a low-level library that interacts with RPC nodes directly. There is a requirement to call the AaveV2
getAllReserveTokens function, and I want to decode the output data.
The particular function that I am calling is this: https://etherscan.io/address/0x057835Ad21a177dbdd3090bB1CAE03EaCF78Fc6d#readContract#F3
When I do an eth_call, the output is a long output, I have pasted it here: https://paste.ee/p/TJ5cr
As you can see on etherscan, the output type is a
tuple, and the abi specifies that the tuple contains a
I understood that the first 32 bytes is the offset, from where the dynamic array starts, so
0000000000000000000000000000000000000000000000000000000000000020 = 32.
The second 32 bytes is the length of the array, and hence, the array is of length
0000000000000000000000000000000000000000000000000000000000000025 = 37.
This all tracks with the output of the etherscan function call.
However, I cannot figure out how to decode the rest of the data. Please can someone help me with this?