trailofbits / manticore

Symbolic execution tool
https://blog.trailofbits.com/2017/04/27/manticore-symbolic-execution-for-humans/
GNU Affero General Public License v3.0
3.68k stars 472 forks source link

reentrancy_symbolic throw ". Solidity failed to generate bytecode for your contract. Check if all the abstract functions are implemented. " #2385

Open strawberrylady99 opened 3 years ago

strawberrylady99 commented 3 years ago

Summary of the problem

Manticore version

0.3.5

Python version

3.8.5

OS / Environment

ubuntu 20.04

Dependencies

appdirs==1.4.4 apturl==0.5.2 argcomplete==1.8.1 bcrypt==3.1.7 blinker==1.4 boto==2.49.0 Brlapi==0.7.0 capstone==4.0.1 certifi==2019.11.28 chardet==3.0.4 Click==7.0 colorama==0.4.3 command-not-found==0.3 cryptography==2.8 crytic-compile==0.1.10 cupshelpers==1.0 cytoolz==0.11.0 dbus-python==1.2.16 defer==1.0.6 distlib==0.3.1 distro==1.4.0 distro-info===0.23ubuntu1 duplicity==0.8.12.0 entrypoints==0.3 eth-hash==0.2.0 eth-typing==2.2.2 eth-utils==1.9.5 fasteners==0.14.1 filelock==3.0.12 future==0.18.2 httplib2==0.14.0 idna==2.8 keyring==18.0.1 language-selector==0.1 launchpadlib==1.10.13 lazr.restfulclient==0.14.2 lazr.uri==1.0.3 lockfile==0.12.2 louis==3.12.0 macaroonbakery==1.3.1 Mako==1.1.0 manticore==0.3.5 MarkupSafe==1.1.0 monotonic==1.5 netifaces==0.10.4 oauthlib==3.1.0 olefile==0.46 paramiko==2.6.0 pexpect==4.6.0 Pillow==7.0.0 ply==3.11 prettytable==2.0.0 progressbar==2.5 protobuf==3.6.1 py-solc-x==0.4.2 pycairo==1.16.2 pycups==1.9.73 pyelftools==0.27 pyevmasm==0.2.3 PyGObject==3.36.0 PyJWT==1.7.1 pymacaroons==0.13.0 PyNaCl==1.3.0 pyRFC3339==1.1 pysha3==1.0.2 python-apt==2.0.0+ubuntu0.20.4.2 python-dateutil==2.7.3 python-debian===0.1.36ubuntu1 python-gnupg==0.4.5 pytz==2019.3 pyxdg==0.26 PyYAML==5.3.1 reportlab==3.5.34 requests==2.22.0 requests-unixsocket==0.2.0 rlp==2.0.1 SecretStorage==2.3.1 semantic-version==2.8.5 simplejson==3.16.0 six==1.14.0 systemd-python==234 toolz==0.11.1 ubuntu-advantage-tools==20.3 ubuntu-drivers-common==0.0.0 Ubuntu-Make==18.9 ufw==0.36 unattended-upgrades==0.1 unicorn==1.0.2rc2 urllib3==1.25.8 usb-creator==0.3.7 virtualenv==20.2.1 wadllib==1.3.3 wasm==1.2 wcwidth==0.2.5 xkit==0.0.0 z3==0.2.0 z3-solver==4.8.9.0

Step to reproduce the behavior

while at manticore-master/examples/evm run: python3 reentrancy_symbolic.py

Expected behavior

The example report vulnerability

Actual behavior

failed

Any relevant logs

reentrancy_symbolic.py:6: ManticoreDeprecationWarning: ManticoreBase.verbosity is deprecated. Use utils.log.set_verbosity instead. m.verbosity(0) Traceback (most recent call last): File "/home/milk/.local/lib/python3.8/site-packages/crytic_compile/platform/solc.py", line 247, in get_version process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) File "/usr/lib/python3.8/subprocess.py", line 854, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'solc'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/milk/.local/lib/python3.8/site-packages/manticore/ethereum/manticore.py", line 266, in _compile_through_crytic_compile crytic_compile = CryticCompile(filename) File "/home/milk/.local/lib/python3.8/site-packages/crytic_compile/crytic_compile.py", line 124, in init self._compile(kwargs) File "/home/milk/.local/lib/python3.8/site-packages/crytic_compile/crytic_compile.py", line 931, in _compile self._platform.compile(self, kwargs) File "/home/milk/.local/lib/python3.8/site-packages/crytic_compile/platform/solc.py", line 108, in compile compiler="solc", version=get_version(solc), optimized=is_optimized(solc_arguments) File "/home/milk/.local/lib/python3.8/site-packages/crytic_compile/platform/solc.py", line 250, in get_version raise InvalidCompilation(error) crytic_compile.platform.exceptions.InvalidCompilation: [Errno 2] No such file or directory: 'solc'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "reentrancy_symbolic.py", line 82, in contract_account = m.solidity_create_contract( File "/home/milk/.local/lib/python3.8/site-packages/manticore/ethereum/manticore.py", line 563, in solidity_create_contract compile_results = self._compile( File "/home/milk/.local/lib/python3.8/site-packages/manticore/ethereum/manticore.py", line 333, in _compile compilation_result = ManticoreEVM._compile_through_crytic_compile( File "/home/milk/.local/lib/python3.8/site-packages/manticore/ethereum/manticore.py", line 300, in _compile_through_crytic_compile raise EthereumError( manticore.exceptions.EthereumError: Errors : [Errno 2] No such file or directory: 'solc' . Solidity failed to generate bytecode for your contract. Check if all the abstract functions are implemented.

I don't know how to solve it,I am excepting your response

ehennenfent commented 3 years ago

You'll need to have version 0.4.x of the Solidity compiler installed to run Manticore. You can find instructions on how to install it here: https://docs.soliditylang.org/en/v0.4.24/installing-solidity.html

rickbeeloo commented 2 years ago

Does not seem to be the problem, 0.4.25 gives the same problem, might depend on the contract?