0

(current compiler is 0.5.16+commit.9c3226ce.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version pragma solidity ^0.4.19; ^----------------------^ Error: Truffle is currently using solc 0.5.16, but one or more of your contracts specify "pragma solidity ^0.4.19". Please update your truffle config or pragma statement(s). (See https://trufflesuite.com/docs/truffle/reference/configuration#compiler-configuration for information on configuring Truffle to use a specific solc compiler version.) Compilation failed. See above. Truffle v5.3.13 (core: 5.3.13) Node v12.18.3

how would I be able to install an older version of solc? and do i need to change the truffle version according to that?

0
0

In your truffle configuration file, you can include your compiler configuration and set your solc version there. You can reference the documentation here

module.exports = {
  compilers: {
    solc: {
      version: <string>, // A version or constraint - Ex. "^0.5.0"
                         // Can also be set to "native" to use a native solc
      docker: <boolean>, // Use a version obtained through docker
      parser: "solcjs",  // Leverages solc-js purely for speedy parsing
      settings: {
        optimizer: {
          enabled: <boolean>,
          runs: <number>   // Optimize for how many times you intend to run the code
        },
        evmVersion: <string> // Default: "istanbul"
      },
      modelCheckerSettings: {
        // contains options for SMTChecker
      }
    }
  }
}

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