|
|
|
@ -186,7 +186,6 @@ class MythrilDisassembler: |
|
|
|
|
except FileNotFoundError: |
|
|
|
|
raise CriticalError("Input file not found: " + file) |
|
|
|
|
except CompilerError as e: |
|
|
|
|
# Extract error message as string |
|
|
|
|
error_msg = str(e) |
|
|
|
|
# Check if error is related to solidity version mismatch |
|
|
|
|
if ( |
|
|
|
@ -197,11 +196,9 @@ class MythrilDisassembler: |
|
|
|
|
solv_pragma_line = error_msg.split("\n")[-3].split("//")[0] |
|
|
|
|
# Grab solidity version from relevant line |
|
|
|
|
solv_match = re.findall(r"[0-9]+\.[0-9]+\.[0-9]+", solv_pragma_line) |
|
|
|
|
# Check if single match exists, else offer generic suggestion |
|
|
|
|
error_suggestion = ( |
|
|
|
|
"<version_number>" if len(solv_match) != 1 else solv_match[0] |
|
|
|
|
) |
|
|
|
|
# Give helpful tip |
|
|
|
|
error_msg = ( |
|
|
|
|
error_msg |
|
|
|
|
+ '\nSolidityVersionMismatch: Try adding the option "--solv ' |
|
|
|
|