Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decodeData bug on specific transaction #64

Open
rohovtsov opened this issue Feb 13, 2021 · 0 comments
Open

decodeData bug on specific transaction #64

rohovtsov opened this issue Feb 13, 2021 · 0 comments

Comments

@rohovtsov
Copy link

Found a transaction which throws an error, id doesn't supposed to throw?
https://etherscan.io/tx/0x501c71c88c06e95d2c67318d8d5034a894cd189ab565decbe3b426ec49a49c9d

abiDecoder.addABI(ERC20_ABI);
abiDecoder.decodeMethod(transaction.input);
{ _to: value out of range (argument="value", value=20, code=INVALID_ARGUMENT, version=bytes/5.0.9)
    at Logger.makeError (/Users/rohovtsov/Desktop/speculation-bot/node_modules/@ethersproject/logger/src.ts/index.ts:205:28)
    at Logger.throwError (/Users/rohovtsov/Desktop/speculation-bot/node_modules/@ethersproject/logger/src.ts/index.ts:217:20)
    at Logger.throwArgumentError (/Users/rohovtsov/Desktop/speculation-bot/node_modules/@ethersproject/logger/src.ts/index.ts:221:21)
    at Object.hexZeroPad (/Users/rohovtsov/Desktop/speculation-bot/node_modules/@ethersproject/bytes/src.ts/index.ts:312:16)
    at AddressCoder.decode (/Users/rohovtsov/Desktop/speculation-bot/node_modules/web3-eth-abi/node_modules/@ethersproject/abi/src.ts/coders/address.ts:24:27)
    at /Users/rohovtsov/Desktop/speculation-bot/node_modules/web3-eth-abi/node_modules/@ethersproject/abi/src.ts/coders/array.ts:108:31
    at Array.forEach (<anonymous>)
    at Object.unpack (/Users/rohovtsov/Desktop/speculation-bot/node_modules/web3-eth-abi/node_modules/@ethersproject/abi/src.ts/coders/array.ts:89:12)
    at TupleCoder.decode (/Users/rohovtsov/Desktop/speculation-bot/node_modules/web3-eth-abi/node_modules/@ethersproject/abi/src.ts/coders/tuple.ts:27:41)
    at AbiCoder.decode (/Users/rohovtsov/Desktop/speculation-bot/node_modules/web3-eth-abi/node_modules/@ethersproject/abi/src.ts/abi-coder.ts:113:22)
    at ABICoder.decodeParametersWith (/Users/rohovtsov/Desktop/speculation-bot/node_modules/web3-eth-abi/lib/index.js:304:30)
    at ABICoder.decodeParameters (/Users/rohovtsov/Desktop/speculation-bot/node_modules/web3-eth-abi/lib/index.js:285:17)
    at Object._decodeMethod [as decodeMethod] (/Users/rohovtsov/Desktop/speculation-bot/node_modules/abi-decoder/index.js:88:28)
    at Object.exports.parseTransactionInput (/Users/rohovtsov/Desktop/speculation-bot/src/core/parse/parser.ts:19:22)
    at /Users/rohovtsov/Desktop/speculation-bot/src/index.ts:10:15
    at process._tickCallback (internal/process/next_tick.js:68:7)
  reason: 'value out of range',
  code: 'INVALID_ARGUMENT',
  argument: 'value',
  value: 20,
  baseType: 'address',
  name: '_to',
  type: 'address' }

For example, ethereum-input-data-decoder parse is successful. The same abi and transaction is used.
https://www.npmjs.com/package/ethereum-input-data-decoder

const decoder = new InputDataDecoder(ERC20_ABI);
decoder.decodeData(transaction.input);
{ address: '0x6c084b601367975ff53814ecbf46576afe0bbe0f',
  value: 99924000000n }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant