2
SyntaxError: Source file requires different compiler version (current compiler is 0.4.19+commit.c4cbbb05.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version
pragma solidity 0.4.15;
^---------------------^
3
  • Could you explain where you get this error and what you are trying to do. Thanks. Mar 15, 2018 at 13:11
  • shashwat@ShashwatGupta:~/Music/BlockChain/ETHERUIM/simple-storage-truffle$ truffle version Truffle v4.1.3 (core: 4.1.3) Solidity v0.4.19 (solc-js) Mar 15, 2018 at 13:12
  • i am facing error while i am deploying contact with truffle Mar 15, 2018 at 13:13

2 Answers 2

3

Maybe you are using some functions that not working on greater versions. Try to set pragram solidity ^0.4.15; if the problem still there, paste here your contract.

4
  • here is the code hastebin.com/oroteyejer.cs Mar 15, 2018 at 13:18
  • @ngCourse Ivan is correct. Using 0.4.15 without the ^ means you are specifying exactly which compiler you are using. If you do ^0.4.15, it represents that version and above.
    – ReyHaynes
    Mar 15, 2018 at 13:19
  • i did mention on ^0.4.15 ... it still have that same error Mar 15, 2018 at 13:22
  • I try in remix.ethereum.org your code and when i change pragma to ^0.4.15 the error disappear. Mar 15, 2018 at 13:25
1

If you are in a Remix environment just go to settings and change the compiler version.

remix settings

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.