-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Error while making the address's indexed in events #1171
Comments
Not sure if this is related to #992 (unable to parse events with indexed parameters if contract compiled with solc 0.4.x), but try with latest version of ethers and see if this is still a problem. |
Hmmm...You are using the latest version of abi. 5.0.9. |
Yes and even solidity 0.7.0. |
Can you provide a transaction hash of a transaction that is causing this issue? I don't quite know what that |
@ricmoo I'm getting this error while running tests itself so no transaction hash available for this. |
If it is possible for you to deploy the contract on some testnet using remix and do this particular transaction that emits this log, pls share the tx hash as it will be easier to debug quickly. |
I think this might be a bug with how the Pinging @alcuadrado, @marekkirejczyk and @sz-piotr. |
Can this be related? NomicFoundation/hardhat#1048 |
That seems like the issue here. :) |
Sure, I'll resume this issue in hardhat repository then. |
Hi,
I've a contract in which I've events with addresses. Everything(tests) is working fine. But as soon as I make the addresses in event as indexed I get the following error:
Error: data out-of-bounds (length=32, offset=64, code=BUFFER_OVERRUN, version=abi/5.0.9) at Logger.makeError (node_modules/@ethersproject/logger/src.ts/index.ts:205:28) at Logger.throwError (node_modules/@ethersproject/logger/src.ts/index.ts:217:20) at Reader._peekBytes (node_modules/@ethersproject/contracts/node_modules/@ethersproject/abi/src.ts/coders/abstract-coder.ts:184:24) at Reader.readBytes (node_modules/@ethersproject/contracts/node_modules/@ethersproject/abi/src.ts/coders/abstract-coder.ts:198:26) at Reader.readValue (node_modules/@ethersproject/contracts/node_modules/@ethersproject/abi/src.ts/coders/abstract-coder.ts:205:36) at AddressCoder.decode (node_modules/@ethersproject/contracts/node_modules/@ethersproject/abi/src.ts/coders/address.ts:28:45) at /Users/Project/node_modules/@ethersproject/contracts/node_modules/@ethersproject/abi/src.ts/coders/array.ts:108:31 at Array.forEach (<anonymous>) at Object.unpack (node_modules/@ethersproject/contracts/node_modules/@ethersproject/abi/src.ts/coders/array.ts:89:12) at TupleCoder.decode (node_modules/@ethersproject/contracts/node_modules/@ethersproject/abi/src.ts/coders/tuple.ts:58:41) at AbiCoder.decode (node_modules/@ethersproject/contracts/node_modules/@ethersproject/abi/src.ts/abi-coder.ts:119:22) at Interface.decodeEventLog (node_modules/@ethersproject/contracts/node_modules/@ethersproject/abi/src.ts/interface.ts:478:47) at Interface.parseLog (node_modules/@ethersproject/contracts/node_modules/@ethersproject/abi/src.ts/interface.ts:567:24) at assertArgsArraysEqual (node_modules/@ethereum-waffle/chai/dist/cjs/matchers/emit.js:38:55) at tryAssertArgsArraysEqual (node_modules/@ethereum-waffle/chai/dist/cjs/matchers/emit.js:54:20) at /Users/Project/node_modules/@ethereum-waffle/chai/dist/cjs/matchers/emit.js:66:13
Solidity code:
event ContributorContributed(address indexed contributor, uint256 amount);
emit ContributorContributed(_sender, _value);
If in the above event I remove the
indexed
keyword then tests are working fine.This is not happening with all the events but most of them.
My Test code:
await expect(owner.withdrawRandomAssets(randomToken.address, false)) .emit(contract, "RandomAssetsWithdrawn") .withArgs(owner, randomToken.address, 5000)
The text was updated successfully, but these errors were encountered: