Fix up some missed bugs

analyze-with-mythx
Nathan 5 years ago
parent 0633944719
commit 134627e37e
  1. 10
      mythril/interfaces/cli.py
  2. 4
      mythril/laser/ethereum/util.py
  3. 6
      mythril/mythx/__init__.py

@ -218,8 +218,9 @@ def main() -> None:
pro_parser = subparsers.add_parser( pro_parser = subparsers.add_parser(
PRO_LIST[0], PRO_LIST[0],
help="Analyzes input with the MythX API (https://mythx.io)", help="Analyzes input with the MythX API (https://mythx.io)",
aliases=PRO_LIST[1], aliases=PRO_LIST[1:],
parents=[utilities_parser, creation_input_parser, output_parser], parents=[utilities_parser, creation_input_parser, output_parser],
formatter_class=RawTextHelpFormatter,
) )
create_pro_parser(pro_parser) create_pro_parser(pro_parser)
@ -276,12 +277,17 @@ def create_pro_parser(parser: ArgumentParser):
:param parser: :param parser:
:return: :return:
""" """
parser.add_argument(
"solidity_files",
nargs="*",
help="Inputs file name and contract name. \n"
"usage: file1.sol:OptionalContractName file2.sol file3.sol:OptionalContractName",
)
parser.add_argument( parser.add_argument(
"--full", "--full",
help="Run a full analysis. Default: quick analysis", help="Run a full analysis. Default: quick analysis",
action="store_true", action="store_true",
) )
parser.add_argument("solidity_file", nargs="*")
def create_read_storage_parser(read_storage_parser: ArgumentParser): def create_read_storage_parser(read_storage_parser: ArgumentParser):

@ -45,8 +45,8 @@ def get_instruction_index(
""" """
index = 0 index = 0
for instr in instruction_list: for instr in instruction_list:
if instr["address"] > address: if instr["address"] >= address:
return index - 1 return index
index += 1 index += 1
return None return None

@ -8,6 +8,10 @@ from mythril.solidity.soliditycontract import SolidityContract
from pythx import Client from pythx import Client
import logging
log = logging.getLogger(__name__)
def analyze(contracts: List[SolidityContract], analysis_mode: str = "quick") -> Report: def analyze(contracts: List[SolidityContract], analysis_mode: str = "quick") -> Report:
""" """
@ -68,7 +72,7 @@ def analyze(contracts: List[SolidityContract], analysis_mode: str = "quick") ->
) )
while not c.analysis_ready(resp.uuid): while not c.analysis_ready(resp.uuid):
print(c.status(resp.uuid).analysis) log.info(c.status(resp.uuid).analysis)
time.sleep(5) time.sleep(5)
for issue in c.report(resp.uuid): for issue in c.report(resp.uuid):

Loading…
Cancel
Save