Skip to content

Commit 65c8930

Browse files
TiecoonEric Hennenfent
authored and
Eric Hennenfent
committed
Add error for unsupported solc versions (#1488)
1 parent cc7811b commit 65c8930

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

manticore/ethereum/manticore.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from queue import Empty as EmptyQueue
77
from subprocess import check_output, Popen, PIPE
88
from typing import Dict, Optional, Union
9+
from pkg_resources import parse_version
910

1011
import io
1112
import os
@@ -16,6 +17,7 @@
1617
import tempfile
1718

1819
from crytic_compile import CryticCompile, InvalidCompilation, is_supported
20+
from crytic_compile.platform.solc import get_version
1921

2022
from ..core.manticore import ManticoreBase
2123
from ..core.smtlib import (
@@ -732,6 +734,14 @@ def solidity_create_contract(
732734
while contract_names:
733735
contract_name_i = contract_names.pop()
734736
try:
737+
# version check
738+
binary = crytic_compile_args.get("solc", "solc")
739+
version = get_version(binary)
740+
if not parse_version(version) < parse_version("0.5.0"):
741+
raise EthereumError(
742+
f"Manticore requires a solc version < 0.5.0 and {version} was found"
743+
)
744+
735745
compile_results = self._compile(
736746
source_code,
737747
contract_name_i,

0 commit comments

Comments
 (0)