|
|
|
@ -6,6 +6,7 @@ from subprocess import Popen, PIPE |
|
|
|
|
import binascii |
|
|
|
|
import os |
|
|
|
|
import json |
|
|
|
|
from pathlib import Path |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def safe_decode(hex_encoded_string): |
|
|
|
@ -45,7 +46,7 @@ def get_solc_json(file, solc_binary="solc", solc_args=None): |
|
|
|
|
) |
|
|
|
|
except FileNotFoundError: |
|
|
|
|
raise CompilerError( |
|
|
|
|
"Compiler not found. Make sure that solc is installed and in PATH, or set the SOLC environment variable." |
|
|
|
|
"Compiler not found.+ Make sure that solc is installed and in PATH, or set the SOLC environment variable." |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
out = stdout.decode("UTF-8") |
|
|
|
@ -73,7 +74,9 @@ def get_indexed_address(index): |
|
|
|
|
|
|
|
|
|
def solc_exists(version): |
|
|
|
|
solc_binary = os.path.join( |
|
|
|
|
os.environ["HOME"], ".py-solc/solc-v" + version, "bin/solc" |
|
|
|
|
os.environ.get("HOME", str(Path.home())), |
|
|
|
|
".py-solc/solc-v" + version, |
|
|
|
|
"bin/solc", |
|
|
|
|
) |
|
|
|
|
if os.path.exists(solc_binary): |
|
|
|
|
return True |
|
|
|
|