Update solcx version (#1410)

* update solcx requirement to version 0.10.0

* update integration with py-solc-x in util

also improves the integration, using library call
get_executable vs direct interaction with the file system
pull/1413/head
JoranHonig 4 years ago committed by GitHub
parent 162b644ffb
commit 9b30a23185
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      mythril/ethereum/util.py
  2. 2
      requirements.txt

@ -14,6 +14,7 @@ from mythril.exceptions import CompilerError
if sys.version_info[1] >= 6:
import solcx
from solcx.exceptions import SolcNotInstalled
def safe_decode(hex_encoded_string):
@ -131,12 +132,15 @@ def solc_exists(version):
"bin/solc",
) # py-solc setup
]
for solc_path in solc_binaries:
if os.path.exists(solc_path):
return solc_path
elif sys.version_info[1] >= 6:
# we are using solc-x for the the 0.5 and higher
solc_binaries = [os.path.join(solcx.__path__[0], "bin", "solc-v" + version)]
for solc_path in solc_binaries:
if os.path.exists(solc_path):
return solc_path
try:
return solcx.install.get_executable(version)
except SolcNotInstalled:
pass
# Last resort is to use the system installation
default_binary = "/usr/bin/solc"

@ -18,7 +18,7 @@ persistent>=4.2.0
plyvel
py-flags
py-evm==0.3.0a13
py-solc-x==0.6.0
py-solc-x==0.10.0
py-solc
pytest>=3.6.0
pytest-cov

Loading…
Cancel
Save