I have over 40 contracts in my project, for example:

  • admin groups
  • votings
  • registry
  • token

In my truffle config I have optimizer enabled with 600 runs.

compilers: {
    solc: {
       version: "0.5.1",
       //docker: true,
       settings: {
        optimizer: {
          enabled: true,
          runs: 600

All my migrations look like in this tutorial:


I'm running migrations which deploy all of them and put addresses to registry and finally locks registry from free test access to restricted and privilege checked voting only access.

The problem is I would like to exclude token from optimizer because it's given to users, so transfer calls should be cheapest, all other contracts are large so they need optimization and are for admins.

How can I do it in truffle?

  • 1. AFAIK, increasing the value of optimization-runs decreases the gas-cost, not the contract-size. So if anything, you want to enable it for the token contract rather than for all the other contracts. 2. This is not supported in Truffle 4.x; I'm not sure about Truffle 5.x. – goodvibration Dec 29 '19 at 14:56

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.