mythril: ValueError: invalid literal for int() with base 16: ''

Description

Error while running mythril on truffle project through the docker container. A few contracts are analysed correctly, and then I see the following issue:

Traceback (most recent call last):
  File "/usr/local/bin/myth", line 4, in <module>
    __import__('pkg_resources').run_script('mythril==0.18.11', 'myth')
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 658, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1438, in run_script
    exec(code, namespace, namespace)
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.18.11-py3.6.egg/EGG-INFO/scripts/myth", line 9, in <module>
    mythril.interfaces.cli.main()
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.18.11-py3.6.egg/mythril/interfaces/cli.py", line 147, in main
    mythril.analyze_truffle_project(args)
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.18.11-py3.6.egg/mythril/mythril.py", line 183, in analyze_truffle_project
    return analyze_truffle_project(self.sigs, *args, **kwargs)  # just passthru by passing signatures for now
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.18.11-py3.6.egg/mythril/support/truffle.py", line 51, in analyze_truffle_project
    sym = SymExecWrapper(ethcontract, address, args.strategy, max_depth=args.max_depth)
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.18.11-py3.6.egg/mythril/analysis/symbolic.py", line 30, in __init__
    self.laser.sym_exec(address)
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.18.11-py3.6.egg/mythril/laser/ethereum/svm.py", line 61, in sym_exec
    transaction.run(self.open_states, self)
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.18.11-py3.6.egg/mythril/laser/ethereum/transaction.py", line 58, in run
    evm.exec()
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.18.11-py3.6.egg/mythril/laser/ethereum/svm.py", line 71, in exec
    new_states, op_code = self.execute_state(global_state)
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.18.11-py3.6.egg/mythril/laser/ethereum/svm.py", line 97, in execute_state
    new_global_states = Instruction(op_code, self.dynamic_loader).evaluate(global_state)
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.18.11-py3.6.egg/mythril/laser/ethereum/instructions.py", line 69, in evaluate
    return instruction_mutator(global_state)
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.18.11-py3.6.egg/mythril/laser/ethereum/instructions.py", line 34, in wrapper
    new_global_states = func(self, global_state_copy)
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.18.11-py3.6.egg/mythril/laser/ethereum/instructions.py", line 552, in codecopy_
    int(bytecode[2*(concrete_code_offset + i): 2*(concrete_code_offset + i + 1)], 16)
ValueError: invalid literal for int() with base 16: ''

How to Reproduce

The repository I am trying to run this on, is a public repository: https://github.com/DigixGlobal/dao-contracts

$ docker run -v $(pwd):/tmp -w "/tmp/" mythril/myth --truffle

Environment

  • OS
$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.5 LTS
Release:	16.04
Codename:	xenial
  • Docker version:
$ docker --version
Docker version 18.06.1-ce, build e68fc7a
  • Python version:
$ python --version
Python 3.5.6
$ python3 --version
Python 3.5.6
  • Mythril version:
$ docker run mythril/myth --version
Mythril version v0.18.11
  • Solidity compiler and version: solc --version
$ solc --version
solc, the solidity compiler commandline interface
Version: 0.4.24+commit.e67f0147.Linux.g++

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 27 (2 by maintainers)

Most upvoted comments

Yeah the ‘—truffle’ option is broken

@birdofpreyru I used this command docker run -v $(pwd):/tmp -w "/tmp/" mythril/myth --truffle from within the truffle project directory