From c296bea59ea3685d5b5043199beeb2bddff8a272 Mon Sep 17 00:00:00 2001 From: Luke Biery Date: Mon, 15 Jul 2019 12:28:19 -0400 Subject: [PATCH] Add error for unsupported solc versions --- manticore/ethereum/manticore.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/manticore/ethereum/manticore.py b/manticore/ethereum/manticore.py index f11ab9c2b..d7d5851d9 100644 --- a/manticore/ethereum/manticore.py +++ b/manticore/ethereum/manticore.py @@ -6,6 +6,7 @@ from queue import Empty as EmptyQueue from subprocess import check_output, Popen, PIPE from typing import Dict, Optional, Union +from pkg_resources import parse_version import io import os @@ -16,6 +17,7 @@ import tempfile from crytic_compile import CryticCompile, InvalidCompilation, is_supported +from crytic_compile.platform.solc import get_version from ..core.manticore import ManticoreBase from ..core.smtlib import ( @@ -732,6 +734,14 @@ def solidity_create_contract( while contract_names: contract_name_i = contract_names.pop() try: + # version check + binary = crytic_compile_args.get("solc", "solc") + version = get_version(binary) + if not parse_version(version) < parse_version("0.5.0"): + raise EthereumError( + f"Manticore requires a solc version < 0.5.0 and {version} was found" + ) + compile_results = self._compile( source_code, contract_name_i,