Open kilicbaran opened 4 years ago
I'm facing the same issue with this transaction at this moment.
I have the same problem! Actually w had developed our decoder and were not using abi-decoder. Recently our code wasn't working and I tried abi-decoder as an alternative solution to see what happens! The same problem happens again.
Finally I fill all data with zero except the part I need the its value, it meets my requirement.
const [log] = logs;
const { data } = log;
// Just keep homeTx
log.data = `0x${'0'.repeat(128)}${data.substring(130, 130 + 64)}${'0'.repeat(
data.length - 2 - 128 - 64,
)};
The transaction linked above is not constructed correctly (has a 0x04 byte prefixed to the address) but that shouldn't make the decode crash. Actually the code that is crashing is @ethersproject/abi
so you may want to open an issue there saying that @ethersproject/abi
should not assume that address
parameters are prefixed by zeros
I've added support in ethers 5.0.12 for supporting legacy Solidity 0.4 external event data.
For more details, please see https://github.com/ethers-io/ethers.js/issues/891.
This is somewhat an edge case but the ERC20 token transfer for this transaction cannot be decoded. I am not sure whether I should open an issue here or @ethersproject/abi.
Sample Code
Exception
I think that there is a typo in the input data for the address parameter and this causes a problem. There is a 4 instead of 0 (I added spaces before and after to make it more readable.)
Function signiture: 0xa9059cbb Address: 00000000000000000000000 4 3f47038d2b20566700a38cd718a537103f7696c9 Value: 000000000000000000000000000000000000000000000000000000000903c63c