If I am given an input like this
0x18cbafe5000000000000000000000000000000000000000000000001885c663d0035bce200000000000000000000000000000000000000000000000000f5666f7fdaa62600000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000c0be713b48822271b362e9fac00479f5134172e80000000000000000000000000000000000000000000000000000000060e93fa900000000000000000000000000000000000000000000000000000000000000020000000000000000000000009813037ee2218799597d83d4a5b6f3b6778218d9000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
If I have a function signature like this "swapExactTokensForETH(uint256,uint256,address[],address,uint256)"
is it possible to decode without the ABI?
I know the types from the signature
"types": [
"uint256",
"uint256",
"address[]",
"address",
"uint256"
],
But when decoded it looks like this:
"inputs": [
"1885c663d0035bce2",
"f5666f7fdaa626",
[
"9813037ee2218799597d83d4a5b6f3b6778218d9",
"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
],
"c0be713b48822271b362e9fac00479f5134172e8",
"60e93fa9"
]
Where index 0 is the uint256, index 1 is the next uint256, index 2 is address[], index 3 is address and index 4 is the uint256
So what logic is there to know that the array in index 2 is pulled from the two addresses at the end of the input from the transaction.
I am trying not to need the ABI to decode the input like this if that is possible
I know I can split up the input from the transaction like this:
[ '000000000000000000000000000000000000000000000001885c663d0035bce2', '00000000000000000000000000000000000000000000000000f5666f7fdaa626', '00000000000000000000000000000000000000000000000000000000000000a0', '000000000000000000000000c0be713b48822271b362e9fac00479f5134172e8', '0000000000000000000000000000000000000000000000000000000060e93fa9', '0000000000000000000000000000000000000000000000000000000000000002', '0000000000000000000000009813037ee2218799597d83d4a5b6f3b6778218d9', '000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' ]
Where the last two in that array from this are the addresses that show up for index 2 in the inputs array above. But in the order of the function signature is third, how do I know that it is pulled from the input from the end?
Is this where the abi comes in useful like decoding using web3? Or is this possible to decode without the abi?