diff --git a/mythril/analysis/modules/exceptions.py b/mythril/analysis/modules/exceptions.py index f1702abf..384b05ad 100644 --- a/mythril/analysis/modules/exceptions.py +++ b/mythril/analysis/modules/exceptions.py @@ -36,7 +36,7 @@ def execute(statespace): "out-of-bounds array access, or assert violations. " ) description += ( - "Note that explicit `assert()` should only be used to check invariants. " + "Note that explicit `assert()` should only be used to check invariants. " "Use `require()` for regular input checking. " ) diff --git a/mythril/analysis/modules/transaction_order_dependence.py b/mythril/analysis/modules/transaction_order_dependence.py index 8d98bfdb..790945c6 100644 --- a/mythril/analysis/modules/transaction_order_dependence.py +++ b/mythril/analysis/modules/transaction_order_dependence.py @@ -43,7 +43,7 @@ def execute(statespace): ) issue.description = ( - "Possible transaction order dependence vulnerability: The value or " + "Possible transaction order dependence vulnerability: The value or " "direction of the call statement is determined from a tainted storage location" ) issues.append(issue) diff --git a/mythril/analysis/report.py b/mythril/analysis/report.py index 91bf7674..ce12c7d2 100644 --- a/mythril/analysis/report.py +++ b/mythril/analysis/report.py @@ -5,6 +5,7 @@ from jinja2 import PackageLoader, Environment import _pysha3 as sha3 import hashlib + class Issue: def __init__( self, @@ -36,7 +37,9 @@ class Issue: keccak.update(bytes.fromhex(bytecode)) self.bytecode_hash = "0x" + keccak.hexdigest() except ValueError: - logging.debug("Unable to change the bytecode to bytes. Bytecode: {}".format(bytecode)) + logging.debug( + "Unable to change the bytecode to bytes. Bytecode: {}".format(bytecode) + ) self.bytecode_hash = "" @property diff --git a/mythril/disassembler/asm.py b/mythril/disassembler/asm.py index 2f447eb2..6e5f73f9 100644 --- a/mythril/disassembler/asm.py +++ b/mythril/disassembler/asm.py @@ -11,6 +11,7 @@ opcodes[254] = ["ASSERT_FAIL", 0, 0, 0] class EvmInstruction: """ Model to hold the information of the disassembly """ + def __init__(self, address, op_code, argument=None): self.address = address self.op_code = op_code @@ -66,7 +67,7 @@ def is_sequence_match(pattern: list, instruction_list: list, index: int) -> bool """ for index, pattern_slot in enumerate(pattern, start=index): try: - if not instruction_list[index]['opcode'] in pattern_slot: + if not instruction_list[index]["opcode"] in pattern_slot: return False except IndexError: return False @@ -95,7 +96,7 @@ def disassemble(bytecode: str) -> list: match = re.search(regex_PUSH, op_code_name) if match: - argument_bytes = bytecode[address + 1: address + 1 + int(match.group(1))] + argument_bytes = bytecode[address + 1 : address + 1 + int(match.group(1))] current_instruction.argument = "0x" + argument_bytes.hex() address += int(match.group(1)) diff --git a/mythril/version.py b/mythril/version.py index dbb80403..209f9662 100644 --- a/mythril/version.py +++ b/mythril/version.py @@ -1,3 +1,3 @@ # This file is suitable for sourcing inside POSIX shell, e.g. bash as # well as for importing into Python -VERSION="v0.18.13" # NOQA +VERSION = "v0.18.13" # NOQA diff --git a/tests/analysis/test_delegatecall.py b/tests/analysis/test_delegatecall.py index c5669b7c..40816cfb 100644 --- a/tests/analysis/test_delegatecall.py +++ b/tests/analysis/test_delegatecall.py @@ -12,6 +12,7 @@ from unittest.mock import MagicMock, patch import pytest_mock from mythril.disassembler.disassembly import Disassembly + def test_concrete_call(): # arrange address = "0x10"