Where can I find the specs to decode Solidity function response?
In my case response is a struct:

struct Response {
uint256[] amounts;
address[] src;
address[] dst;
}
I can deduce struct field (arrays) starting from line 5 (number of element followed by the data) but what is the description of lines 1, 2, 3 4? Line 1 looks like size of each elements?

I found this link to encode data but decoding is not described and looks a little bit different https://docs.soliditylang.org/en/v0.8.17/abi-spec.html#function-selector-and-argument-encoding.

I found that adding +32 on values lines 2, 3, and 4 give me the offset of each array result.

Help is welcome, thanks.

Nov 13, 2022, 4:44 PM
Is another contract or inside the same contract?
Nov 15, 2022, 1:33 PM
The same contract.
I receive this link https://docs.soliditylang.org/en/v0.8.17/abi-spec.html#use-of-dynamic-types

It describes how data must be parsed
Nov 15, 2022, 6:34 PM

© 2024 Draquery.com All rights reserved.