0

Truffle v5.2.2 (core: 5.2.2) Solidity v0.5.16 (solc-js) Node v12.19.0 Web3.js v1.2.9
where is that solidity version coming from? I know i install truffle globally sometimes, so does it ship with solidity or what. Also does solidity version automatically mean solidity compiler version?

1
  • 1
    I'm not sure, but I think this solidity version (yes compiler version) comes with truffle as default, and I think you could change it the used compiler version in the config of the truffle project. down in the truffle-config file
    – Majd TL
    Mar 6 at 22:01
2

I know i install truffle globally sometimes,

You can.

If you switch between projects a lot it might be better to install locally, per project, and then access with ./node_modules/.bin/truffle. That can help when you have to climb into the old time-machine to work on something created way back.

where is that solidity version coming from Solidity v0.5.16

Just a default that corresponds to Truffle v5.2.2 (core: 5.2.2)

You can change that in truffle-config.js in the root folder of your truffle project. Here, it is configured to get 0.7.6 and "optimize" with "200" runs. Not using the docker container option.

  // Configure your compilers
  compilers: {
    solc: {
      version: "0.7.6",    // Fetch exact version from solc-bin (default: truffle's version)
      // docker: true,        // Use "0.7.6" you've installed locally with docker (default: false)
      settings: {          // See the solidity docs for advice about optimization and evmVersion
        optimizer: {
          enabled: true,
          runs: 200
        }
      //  evmVersion: "byzantium"
      }
    }
  }

Also does solidity version automatically mean solidity compiler version?

Yes.

Hope it helps.

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.