Consensys / abi-decoder

Nodejs and Javascript library for decoding data params and events from ethereum transactions
GNU General Public License v3.0
641 stars 223 forks source link

decode error #107

Open phpmac opened 5 months ago

phpmac commented 5 months ago
recipient: value out of range (argument="value", value=20, code=INVALID_ARGUMENT, version=bytes/5.7.0)
    at Logger.makeError (/Users/a/Downloads/hardhat/node_modules/@ethersproject/logger/src.ts/index.ts:269:28)
    at Logger.throwError (/Users/a/Downloads/hardhat/node_modules/@ethersproject/logger/src.ts/index.ts:281:20)
    at Logger.throwArgumentError (/Users/a/Downloads/hardhat/node_modules/@ethersproject/logger/src.ts/index.ts:285:21)
    at hexZeroPad (/Users/a/Downloads/hardhat/node_modules/@ethersproject/bytes/src.ts/index.ts:323:16)
    at AddressCoder.decode (/Users/a/Downloads/hardhat/node_modules/@ethersproject/abi/src.ts/coders/address.ts:28:37)
    at /Users/a/Downloads/hardhat/node_modules/@ethersproject/abi/src.ts/coders/array.ts:108:31
    at Array.forEach (<anonymous>)
    at unpack (/Users/a/Downloads/hardhat/node_modules/@ethersproject/abi/src.ts/coders/array.ts:89:12)
    at TupleCoder.decode (/Users/a/Downloads/hardhat/node_modules/@ethersproject/abi/src.ts/coders/tuple.ts:58:47)
    at AbiCoder.decode (/Users/a/Downloads/hardhat/node_modules/@ethersproject/abi/src.ts/abi-coder.ts:118:22) {
  reason: 'value out of range',
  code: 'INVALID_ARGUMENT',
  argument: 'value',
  value: 20,
  baseType: 'address',
  type: 'address'
}

https://etherscan.io/tx/0x6335ebc4c023c16e9a3a01a195ed999717a9b6c5688eb68620ecafddddee296e

input data is 0xa9059cbb066e82b0c41d5457288a8db0d6c295d92a9844d8fbe948a56a93be730b9b948a0000000000000000000000000000000000000000000000000000000035a4e900

phpmac commented 5 months ago

我已经更换为 https://viem.sh/docs/abi/decodeAbiParameters.html

这个好一些

https://viem.sh/docs/contract/decodeFunctionData.html

这个可以解析,兄弟们关注我!