Truffle – How to Control Compiler Settings with Truffle

truffle

I'm using truffle development environment for prototype contract development and I need to change compiler setting (e.g. turn optimization on and off).

The documentation for the development environment does not say how to control the compiler settings. How do I do so?

Best Answer

The configurations for the compiler settings can be found in the advanced section of the documentation:

You will need to update your truffle.js configuration file to include the following:


module.exports = {
...
    solc: {
      settings: {
        optimizer: {
          enabled: true,
          runs: 1500
        }
      }
    }
}
Related Topic