Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add error for unsupported solc versions #1488

Merged
merged 1 commit into from
Jul 22, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions manticore/ethereum/manticore.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 (
Expand Down Expand Up @@ -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,
Expand Down