Coming from here: How do I specify a different Solidity version in a Truffle contract?
I still have the same issue, except that even after trying all of the suggested solutions, and even having the truffle-config.js
working before by specifying the right version there, my new project doesn't seem to take the version entered in consideration.
I'm working with:
Truffle v5.1.15 (core: 5.1.15)
Solidity - 0.6.4 (solc-js)
Node v12.16.1
Web3.js v1.2.1
And this is my compiler code:
compilers: {
solc: {
version: "0.6.4"
},
}
Whenever I start a new .sol file with pragma solidity ^0.6.4
, pragma
is highlighted with the following error:
SyntaxError: Source file requires different compiler version (current compiler is 0.4.17+commit.bdeb9e52.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version
pragma solidity ^0.6.4;
^---------------------^
So my IDE still believes my compiler is going to be 0.4.17...
If I keep writing, I keep getting errors due to deprecated error highlighting (constructor
and emit
events not working, now
is okay...).
Does anyone know what I might have missed?
npm install -g truffle
)? – goodvibration Mar 18 '20 at 17:46npm uninstall -g truffle
followed bynpm install -g truffle
, I've already tried disabling and reenabling thesolidity
extension by Juan Blanco, but everything is still the same... So I think I have all the latest versions of everything :/ – Thanh-Quy Nguyen Mar 18 '20 at 17:47npm install solc@0.6.4
in your project it will use that version. – Ismael Mar 18 '20 at 18:28