|
|
|
@ -51,9 +51,7 @@ Consider using the latest version of Solidity for testing.""" |
|
|
|
|
OLD_VERSION_TXT = "allows old versions" |
|
|
|
|
LESS_THAN_TXT = "uses lesser than" |
|
|
|
|
|
|
|
|
|
TOO_RECENT_VERSION_TXT = ( |
|
|
|
|
"necessitates a version too recent to be trusted. Consider deploying with 0.6.12/0.7.6" |
|
|
|
|
) |
|
|
|
|
TOO_RECENT_VERSION_TXT = "necessitates a version too recent to be trusted. Consider deploying with 0.6.12/0.7.6/0.8.8" |
|
|
|
|
BUGGY_VERSION_TXT = ( |
|
|
|
|
"is known to contain severe issues (https://solidity.readthedocs.io/en/latest/bugs.html)" |
|
|
|
|
) |
|
|
|
@ -66,6 +64,10 @@ Consider using the latest version of Solidity for testing.""" |
|
|
|
|
"0.6.12", |
|
|
|
|
"0.7.5", |
|
|
|
|
"0.7.6", |
|
|
|
|
"0.8.4", |
|
|
|
|
"0.8.5", |
|
|
|
|
"0.8.6", |
|
|
|
|
"0.8.7", |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
# Indicates the versions that should not be used. |
|
|
|
@ -80,6 +82,8 @@ Consider using the latest version of Solidity for testing.""" |
|
|
|
|
"^0.5.14", |
|
|
|
|
"0.6.9", |
|
|
|
|
"^0.6.9", |
|
|
|
|
"0.8.8", |
|
|
|
|
"^0.8.8", |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
def _check_version(self, version): |
|
|
|
@ -87,6 +91,8 @@ Consider using the latest version of Solidity for testing.""" |
|
|
|
|
if op and op not in [">", ">=", "^"]: |
|
|
|
|
return self.LESS_THAN_TXT |
|
|
|
|
version_number = ".".join(version[2:]) |
|
|
|
|
if version_number in self.BUGGY_VERSIONS: |
|
|
|
|
return self.BUGGY_VERSION_TXT |
|
|
|
|
if version_number not in self.ALLOWED_VERSIONS: |
|
|
|
|
if list(map(int, version[2:])) > list(map(int, self.ALLOWED_VERSIONS[-1].split("."))): |
|
|
|
|
return self.TOO_RECENT_VERSION_TXT |
|
|
|
@ -144,6 +150,15 @@ Consider using the latest version of Solidity for testing.""" |
|
|
|
|
results.append(json) |
|
|
|
|
|
|
|
|
|
if self.compilation_unit.solc_version not in self.ALLOWED_VERSIONS: |
|
|
|
|
|
|
|
|
|
if self.compilation_unit.solc_version in self.BUGGY_VERSIONS: |
|
|
|
|
info = [ |
|
|
|
|
"solc-", |
|
|
|
|
self.compilation_unit.solc_version, |
|
|
|
|
" ", |
|
|
|
|
self.BUGGY_VERSION_TXT, |
|
|
|
|
] |
|
|
|
|
else: |
|
|
|
|
info = [ |
|
|
|
|
"solc-", |
|
|
|
|
self.compilation_unit.solc_version, |
|
|
|
|