Skip to content

Commit

Permalink
Handle newer solc-x versions (#1880)
Browse files Browse the repository at this point in the history
* Handle newer solc-x versions

* Support newer version in requirements
  • Loading branch information
norhh authored Aug 27, 2024
1 parent 99bf452 commit ea60b14
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions mythril/ethereum/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,12 @@ def extract_version(file: typing.Optional[str]):
version_constraint = semver.SimpleSpec(version_spec)

for version in all_versions:
if version in version_constraint:
if "0.5.17" in str(version):
semver_version = semver.Version(str(version))
if semver_version in version_constraint:
if "0.5.17" in str(semver_version):
# Solidity 0.5.17 Does not compile in a lot of cases.
continue
return str(version)
return str(semver_version)


def extract_binary(file: str) -> Tuple[str, str]:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ numpy
persistent>=4.2.0
py-flags
py-evm==0.10.1b1
py-solc-x<2.0.0
py-solc-x<3.0.0
py-solc
pyparsing>=2.0.2,<4
requests
Expand Down

0 comments on commit ea60b14

Please sign in to comment.