Skip to content

Commit

Permalink
Merge pull request #1000 from crytic/dev-disable-prop-ci
Browse files Browse the repository at this point in the history
Disable slither-prop from CI
  • Loading branch information
montyly authored Dec 10, 2021
2 parents 1df9486 + b09a43d commit a4d7f98
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
"slither_config",
"truffle",
"upgradability",
"prop",
# "prop",
"flat"]
steps:
- uses: actions/checkout@v1
Expand Down
32 changes: 24 additions & 8 deletions slither/detectors/attributes/incorrect_solc.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class IncorrectSolc(AbstractDetector):
- 0.5.16 - 0.5.17
- 0.6.11 - 0.6.12
- 0.7.5 - 0.7.6
- 0.8.4 - 0.8.7
Use a simple pragma version that allows any of these versions.
Consider using the latest version of Solidity for testing."""
# endregion wiki_recommendation
Expand All @@ -51,9 +52,7 @@ class IncorrectSolc(AbstractDetector):
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.7"
BUGGY_VERSION_TXT = (
"is known to contain severe issues (https://solidity.readthedocs.io/en/latest/bugs.html)"
)
Expand All @@ -66,6 +65,10 @@ class IncorrectSolc(AbstractDetector):
"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.
Expand All @@ -80,13 +83,17 @@ class IncorrectSolc(AbstractDetector):
"^0.5.14",
"0.6.9",
"^0.6.9",
"0.8.8",
"^0.8.8",
]

def _check_version(self, version):
op = version[0]
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
Expand Down Expand Up @@ -144,11 +151,20 @@ def _detect(self):
results.append(json)

if self.compilation_unit.solc_version not in self.ALLOWED_VERSIONS:
info = [
"solc-",
self.compilation_unit.solc_version,
" is not recommended for deployment\n",
]

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,
" is not recommended for deployment\n",
]

json = self.generate_result(info)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
},
{
"elements": [],
"description": "solc-0.5.14 is not recommended for deployment\n",
"markdown": "solc-0.5.14 is not recommended for deployment\n",
"description": "solc-0.5.14 is known to contain severe issues (https://solidity.readthedocs.io/en/latest/bugs.html)",
"markdown": "solc-0.5.14 is known to contain severe issues (https://solidity.readthedocs.io/en/latest/bugs.html)",
"first_markdown_element": "",
"id": "839b9aa9c05b3f4bfeb7aefa9b7a69d82a322bf527f21bbf7080a7855f003803",
"id": "d29c07fc4fd9f7602b9f99b17646c6ce1a1c10740d60888a7a706f2537f6e59d",
"check": "solc-version",
"impact": "Informational",
"confidence": "High"
Expand Down

0 comments on commit a4d7f98

Please sign in to comment.