Hello I'm working on ethereum project using truffle framework, I want to know what is the latest solidity compiler version supported by truffle.
2 Answers
You may specify...
- any solc-js version (using semver) listed at solc-bin. Specify the one you want and Truffle will get it for you.
- "native" to use a natively compiled solc binary (you'll need to install this yourself, links to help below).
- a dockerized solc tag from one of images published here.
- a path to a locally available solc
- "pragma" to have Truffle autodetect solc versions from your source files. This can be used to compile using multiple versions of solc.
- a solc-js parser for faster docker and native compilations
Source: https://trufflesuite.com/docs/truffle/reference/configuration#solc
Any of them, but you need to change the config file for Truffle, Truffle-config.js. If you want to use 0.8.7, you must change (or add) the following
compilers: {
solc: {
version: "0.8.7"
}
}
next time you compile the contract, you will see that Truffle will use this version to compile the code.