I've collected some random smart contracts from the internet, many of them do not specify compiler version using pragma in their source code. Is there any way or any tool that can help me identify the version of a smart contract given only the source code? Want to automate the experiment without manually figuring out which compiler a contract needs.
1 Answer
Solidity is backward compatible within the same minor version. To determine which version of solc will compile a contract it should be enough compiling with the latest version in each minor version.
- 0.6.6
- 0.5.17
- 0.4.26
- 0.3.6
- 0.2.2
- 0.1.7