question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error while making the address's indexed in events

See original GitHub issue

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)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ShivamDev31commented, Nov 26, 2020

Sure, I’ll resume this issue in hardhat repository then. Thanks everyone 😃

0reactions
ricmoocommented, Nov 26, 2020

That seems like the issue here. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

I'm getting an error when i have more than 3 indexed arg for ...
TypeError: Indexed expression has to be a type, mapping or array (is function (address) view external returns (string memory,string memory...) 0.
Read more >
Event ID 41309 logged in Windows Event logs repeatedly ...
Problem. After a restart of the indexing service, Event ID 41309 shows up in the event logs repeatedly every 5 minutes.
Read more >
Multiple indexed event fields are not supported by web3j?
I'm having Ethereum smart contract with function ...
Read more >
Troubleshooting index lifecycle management errors - Elastic
When ILM executes a lifecycle policy, it's possible for errors to occur while performing the necessary index operations for a step. When this...
Read more >
Failed to notify index event listener - how to solve related issues
Before you begin reading this guide, we recommend you run AutoOps for Elasticsearch which can resolve issues that cause many errors. This guide...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found