Truffle: Error: Returned values aren't valid, did it run Out of Gas?

Created on 11 Jul 2019  路  3Comments  路  Source: trufflesuite/truffle

Issue

The problem is if one contract have an event A(uint indexed a) and call this event with other contract, how haves the same event but without indexed event A(uint a); truffle cant interprate who event raise

Steps to Reproduce

git clone [email protected]:rotcivegaf/reproduce_truffle_bug.git
cd reproduce_truffle_bug
npm install
In one terminal:
./node_modules/.bin/ganache-cli
In other terminal:
./node_modules/.bin/truffle test

Expected Behavior

Should not throw error

Actual Results

Throw error:

Error: Returned values aren't valid, did it run Out of Gas?
      at ABICoder.decodeParameters (node_modules/truffle/build/webpack:/~/web3-eth-abi/src/index.js:226:1)
      at ABICoder.decodeParameter (node_modules/truffle/build/webpack:/~/web3-eth-abi/src/index.js:213:1)
      at .../test-truffle-bug/node_modules/truffle/build/webpack:/~/web3-eth-abi/src/index.js:274:14
      at Array.forEach (<anonymous>)
      at ABICoder.decodeLog (node_modules/truffle/build/webpack:/~/web3-eth-abi/src/index.js:270:1)
      at logs.map.log (node_modules/truffle/build/webpack:/packages/truffle-contract/lib/utils.js:62:1)
      at Array.map (<anonymous>)
      at Function.decodeLogs (node_modules/truffle/build/webpack:/packages/truffle-contract/lib/utils.js:46:1)
      at Promise.receipt (node_modules/truffle/build/webpack:/packages/truffle-contract/lib/handlers.js:98:1)
      at Promise.emit (node_modules/truffle/build/webpack:/~/eventemitter3/index.js:89:1)
      at .../test-truffle-bug/node_modules/truffle/build/webpack:/~/web3-eth/~/web3-core-method/src/index.js:353:1
      at process.internalTickCallback (internal/process/next_tick.js:77:7)

Environment

  • Operating System: Linux
  • Ethereum client: Ganache CLI v6.4.5 (ganache-core: 2.5.7)
  • Truffle version: Truffle v5.0.26 (core: 5.0.26)
  • Solidity - 0.5.8 (solc-js)
  • Web3.js v1.0.0-beta.37
  • node version: Node v11.5.0
  • npm version: 6.4.1

Most helpful comment

I'm actually redoing how we do event decoding at the moment, and this is one of the problems my new event decoding system will solve. However, I'm afraid this new system won't be ready for a while. I don't know if there's some easier quicker solution we can do in the meantime (unfortunately from what I've seen there probably isn't), but I thought you'd want to know that even if not, this is something we are presently working on.

All 3 comments

I'm actually redoing how we do event decoding at the moment, and this is one of the problems my new event decoding system will solve. However, I'm afraid this new system won't be ready for a while. I don't know if there's some easier quicker solution we can do in the meantime (unfortunately from what I've seen there probably isn't), but I thought you'd want to know that even if not, this is something we are presently working on.

Well if this can help somebody, my real problem is the events on ERC20:

event Transfer(address indexed _from, address indexed _to, uint256 _value)
event Approval(address indexed _owner, address indexed _spender, uint256 _value)

and the events on ERC721:

event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId)
event Approval(address indexed _owner, address indexed _approved, uint256 indexed _tokenId)

I solved this using the same indexed arguments, in my case the ERC20 its a mock and the event in ERC20 are:

event Transfer(address indexed _from, address indexed _to, uint256 indexed _value)
event Approval(address indexed _owner, address indexed _spender, uint256 indexed _value)

@rotcivegaf thanks for bringing this up! @haltman-at is hard at work to fix this issue for good, and we appreciate you sharing how you were able to address it in the meantime. Closing this issue because it appears to be "resolved". Again, thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JustinDrake picture JustinDrake  路  4Comments

ferittuncer picture ferittuncer  路  3Comments

ripper234 picture ripper234  路  4Comments

Katsu1991 picture Katsu1991  路  3Comments

maximilianh picture maximilianh  路  3Comments