I have created a Private Ethereum network and I have deployed a contract in it..

Now I am trying to post a transaction in that contract but I m getting error that transaction has been reverted by EVM without any further details..

What should be the best way to diagnose such cases..

Note : I have tried one using debug.trace but it give me whole dump of ops code level details which i m not sure how to use for diagnose.. Appreciate your valueable inputsenter image description here

Regards Dev


I'd recommend to use remix.ethereum.org interactive debugger. It will let you trace a transaction step by step and inspect the memory, stack and contract storage.

From my experience the first error we make is not enough gas. For web3.js the defaul gas of 90000 might not be enough for a complex function. Try explicitely passing a higher gas like 1M gas to start.

Other common bugs are:

  • require or assert condition fails
  • uninitialized variables (make sure you initialize variables correctly)
  • accesing an array invalid index (validate with array length)
  • call to other contract fails (check for invalid conditions on the called contract)
  • So You mean I can connect remix with my private network and then dubug from it.. ? or do I need to deploy my contract into remix VM enviorment and then debug? – Devraj Singh Rawat Oct 23 '18 at 6:06
  • I try with the internal Javascript VM and it kinda worked (it will confuse if you jump into other function, but using breakpoints you can workaround it). I didn't try with a private testnet. – Ismael Oct 23 '18 at 15:49

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.