Error while making the address's indexed in events
See original GitHub issueHi,
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)
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (4 by maintainers)
Top GitHub Comments
Sure, I’ll resume this issue in hardhat repository then. Thanks everyone 😃
That seems like the issue here. 😃