react-uport-box icon indicating copy to clipboard operation
react-uport-box copied to clipboard

Pragma Syntax

Open RyanJoseph15 opened this issue 6 years ago • 0 comments

I was following the README on getting setup and ran into the following truffle compile errors:

ryan$ truffle compile
Compiling ./contracts/Migrations.sol...
Compiling ./contracts/SimpleStorage.sol...

/Users/ryan/Development/react-uport/contracts/Migrations.sol:1:1: SyntaxError: Source file requires different compiler version (current compiler is 0.5.0+commit.1d4f565a.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version
pragma solidity ^0.4.24;
^----------------------^
,/Users/ryan/Development/react-uport/contracts/SimpleStorage.sol:1:1: SyntaxError: Source file requires different compiler version (current compiler is 0.5.0+commit.1d4f565a.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version
pragma solidity ^0.4.17;
^----------------------^
Compilation failed. See above.
Truffle v5.0.4 (core: 5.0.4)
Node v9.11.1

I found this stackoverflow article that pointed me in the direction of how to get around this with my version of Truffle and Node. tl;dr: pragma solidity ^0.4.24pragma solidity >=0.4.24 in those two files.

This obviously depends on the versions people are running. But, it may be worth making the change or documenting that if people run into similar issues, how to immediately resolve it without having to duplicate research.

RyanJoseph15 avatar Feb 17 '19 02:02 RyanJoseph15