diff --git a/scripts/travis_test_printers.sh b/scripts/travis_test_printers.sh index fca2b9d89..bad5631f9 100755 --- a/scripts/travis_test_printers.sh +++ b/scripts/travis_test_printers.sh @@ -12,3 +12,4 @@ if [ $? -ne 0 ]; then exit 1 fi +slither examples/scripts/test_evm_api.sol --print evm --solc solc-0.5.1 diff --git a/slither/analyses/evm/convert.py b/slither/analyses/evm/convert.py index 404e6bd97..a86a4aaa5 100644 --- a/slither/analyses/evm/convert.py +++ b/slither/analyses/evm/convert.py @@ -19,6 +19,9 @@ def get_evm_instructions(obj): slither = obj.slither + if not slither.crytic_compile: + raise SlitherError('EVM features require to compile with crytic-compile') + contract_info = {} function_info = {} node_info = {} diff --git a/slither/printers/summary/evm.py b/slither/printers/summary/evm.py index 58b6c2ccb..98de8391a 100644 --- a/slither/printers/summary/evm.py +++ b/slither/printers/summary/evm.py @@ -1,10 +1,9 @@ """ Module printing evm mapping of the contract """ - from slither.printers.abstract_printer import AbstractPrinter from slither.analyses.evm import generate_source_to_evm_ins_mapping, load_evm_cfg_builder -from slither.utils.colors import blue, green, magenta +from slither.utils.colors import blue, green, magenta, red class PrinterEVM(AbstractPrinter): @@ -21,6 +20,12 @@ class PrinterEVM(AbstractPrinter): """ txt = "" + + if not self.slither.crytic_compile: + txt = 'The EVM printer requires to compile with crytic-compile' + self.info(red(txt)) + res = self.generate_output(txt) + return res evm_info = self._extract_evm_info(self.slither) for contract in self.slither.contracts_derived: