zemse / hardhat-tracer

🕵️ allows you to see internal calls, events and storage operations in the console
MIT License
341 stars 35 forks source link

Bug report #24

Open k06a opened 1 year ago

k06a commented 1 year ago
Error in printDebugTraceElseLogs: to: value out of range (argument="value", value=20, code=INVALID_ARGUMENT, version=bytes/5.7.0)
    at Logger.makeError (/Users/k06a/Projects/nggyu/node_modules/@ethersproject/logger/src.ts/index.ts:269:28)
    at Logger.throwError (/Users/k06a/Projects/nggyu/node_modules/@ethersproject/logger/src.ts/index.ts:281:20)
    at Logger.throwArgumentError (/Users/k06a/Projects/nggyu/node_modules/@ethersproject/logger/src.ts/index.ts:285:21)
    at hexZeroPad (/Users/k06a/Projects/nggyu/node_modules/@ethersproject/bytes/src.ts/index.ts:323:16)
    at AddressCoder.decode (/Users/k06a/Projects/nggyu/node_modules/ethers/node_modules/@ethersproject/abi/src.ts/coders/address.ts:28:37)
    at /Users/k06a/Projects/nggyu/node_modules/ethers/node_modules/@ethersproject/abi/src.ts/coders/array.ts:108:31
    at Array.forEach (<anonymous>)
    at unpack (/Users/k06a/Projects/nggyu/node_modules/ethers/node_modules/@ethersproject/abi/src.ts/coders/array.ts:89:12)
    at TupleCoder.decode (/Users/k06a/Projects/nggyu/node_modules/ethers/node_modules/@ethersproject/abi/src.ts/coders/tuple.ts:58:47)
    at AbiCoder.decode (/Users/k06a/Projects/nggyu/node_modules/ethers/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'
}
If you think the above error is a bug, please report it to https://github.com/zemse/hardhat-tracer/issues/new, meanwhile falling back to --logs:
zemse commented 1 year ago

While unpacking address from a word, it looks like higher 12 bytes were not zero. Is it possible for you to provide what commands were used or any more info that can help me reproduce this issue?

k06a commented 1 year ago

@zemse maybe it was selector collision and wrong argument types?

zemse commented 1 year ago

v1 just tried to find a selector match, while v2 uses a mapping from function selectors to an array of possible abis (relevant code), so it is more likely to decode this correctly. But if you run into any issues with it, do let me know :)