Similar to this question, I am trying to debug a setup that is exceeding the default gas limit since upgrading to Truffle 4.

Turning on the newly disabled (by default) optimizer seems to be a commonly suggested solution that commonly does not work (as in my case). I tried increasing the gasLimit in my truffle.js file and the contracts indeed compiled and passed their tests as they did with Truffle 3.

I want to find out which contract or contracts are too large and therefore need to be refactored to pass the default gas limits. The error message currently gives no indications which contract or contracts are exceeding block gas limits. Any debugging techniques would be helpful.


1 Answer 1


I run into the same problem with truffle 4.0.1. After some investigation and advise from the truffle team I tried it with truffle develop and everything worked fine again. If you use truffle develop you don't need testrpc anymore. truffle develop has some advantages and cool features compared to testrpc.

You can find instructions about truffle devlop here: https://github.com/trufflesuite/truffle/releases/tag/v4.0.0

  • thanks for the suggestion! That worked well! Any idea how this would look in a .travis.yml file? Commented Nov 9, 2017 at 20:05
  • Can you explain what you mean when you say you used truffle develop? I am trying to run the command truffle migrate and I get the out of gas error. how does truffle develop fix that?
    – wilblack
    Commented Nov 11, 2017 at 18:32
  • You can find the instructions here: github.com/trufflesuite/truffle/releases/tag/v4.0.0 Scroll down to: Truffle Develop: Faster Development Cycles. If you want to migrate a contract you can start up the truffle devlop and then a kind of a shell will fire up. Inside this shell you can type migrate and your contract will be migrated. I edited my answer above and added the link to the instructions.
    – Bumblebee
    Commented Nov 11, 2017 at 19:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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