I'm debugging a contract function with Truffle. It always throws the following error:

Error: VM Exception while processing transaction: revert

However, I'm certain that the function has reached the last line, since on the last line I'm emitting an event and Truffle reports that the event has been emitted.

How is it possible that the function reaches the last line which is evident by the fact that the event was successfully emitted, and yet I'm still getting the error above?

  • Without the source of the function is hard to tell. But, if a transaction is reversed then no event is emitted. It is possible the event you are receiving is from another transaction. – Ismael Apr 16 '18 at 5:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.