diff --git a/mythril/analysis/modules/delegatecall.py b/mythril/analysis/modules/delegatecall.py index eeb81e48..30b850ef 100644 --- a/mythril/analysis/modules/delegatecall.py +++ b/mythril/analysis/modules/delegatecall.py @@ -46,9 +46,10 @@ def _concrete_call(call, state, address, meminstart): issue = Issue( contract=call.node.contract_name, - function=call.node.function_name, + function_name=call.node.function_name, address=address, swc_id=DELEGATECALL_TO_UNTRUSTED_CONTRACT, + bytecode=state.environment.code.bytecode, title="Call data forwarded with delegatecall()", _type="Informational", ) @@ -68,9 +69,10 @@ def _concrete_call(call, state, address, meminstart): def _symbolic_call(call, state, address, statespace): issue = Issue( contract=call.node.contract_name, - function=call.node.function_name, + function_name=call.node.function_name, address=address, swc_id=DELEGATECALL_TO_UNTRUSTED_CONTRACT, + bytecode=state.environment.code.bytecode, title=call.type + " to a user-supplied address", ) diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index 12172982..462c6eff 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -63,9 +63,10 @@ def execute(statespace): ) issue = Issue( contract=call.node.contract_name, - function=call.node.function_name, + function_name=call.node.function_name, address=address, swc_id=swc_type, + bytecode=state.environment.code.bytecode, title="Dependence on predictable environment variable", _type="Warning", description=description, @@ -111,8 +112,9 @@ def execute(statespace): issue = Issue( contract=call.node.contract_name, - function=call.node.function_name, + function_name=call.node.function_name, address=address, + bytecode=call.state.environment.code.bytecode, title="Dependence on predictable variable", _type="Warning", description=description, @@ -140,8 +142,9 @@ def execute(statespace): ) issue = Issue( contract=call.node.contract_name, - function=call.node.function_name, + function_name=call.node.function_name, address=address, + bytecode=state.environment.code.bytecode, title="Dependence on predictable variable", _type="Informational", description=description, diff --git a/mythril/analysis/modules/deprecated_ops.py b/mythril/analysis/modules/deprecated_ops.py index ec38e272..a5ffea2f 100644 --- a/mythril/analysis/modules/deprecated_ops.py +++ b/mythril/analysis/modules/deprecated_ops.py @@ -34,9 +34,10 @@ def execute(statespace): issue = Issue( contract=node.contract_name, - function=node.function_name, + function_name=node.function_name, address=instruction["address"], title="Use of tx.origin", + bytecode=state.environment.code.bytecode, _type="Warning", swc_id=TX_ORIGIN_USAGE, description=description, diff --git a/mythril/analysis/modules/ether_send.py b/mythril/analysis/modules/ether_send.py index ae723333..c974cc27 100644 --- a/mythril/analysis/modules/ether_send.py +++ b/mythril/analysis/modules/ether_send.py @@ -60,11 +60,12 @@ def _analyze_state(state, node): issue = Issue( contract=node.contract_name, - function=node.function_name, + function_name=node.function_name, address=instruction["address"], swc_id=UNPROTECTED_ETHER_WITHDRAWAL, title="Ether send", _type="Warning", + bytecode=state.environment.code.bytecode, description="It seems that an attacker is able to execute an call instruction," " this can mean that the attacker is able to extract funds " "out of the contract.".format(target), diff --git a/mythril/analysis/modules/exceptions.py b/mythril/analysis/modules/exceptions.py index 0768fac4..f1702abf 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. " ) @@ -49,12 +49,13 @@ def execute(statespace): issues.append( Issue( contract=node.contract_name, - function=node.function_name, + function_name=node.function_name, address=address, swc_id=ASSERT_VIOLATION, title="Exception state", _type="Informational", description=description, + bytecode=state.environment.code.bytecode, debug=debug, ) ) diff --git a/mythril/analysis/modules/external_calls.py b/mythril/analysis/modules/external_calls.py index 1b45205a..d85fe45a 100644 --- a/mythril/analysis/modules/external_calls.py +++ b/mythril/analysis/modules/external_calls.py @@ -115,11 +115,12 @@ def execute(statespace): issue = Issue( contract=call.node.contract_name, - function=call.node.function_name, + function_name=call.node.function_name, address=address, title="Message call to external contract", _type="Warning", description=description, + bytecode=state.environment.code.bytecode, swc_id=REENTRANCY, ) @@ -129,11 +130,12 @@ def execute(statespace): issue = Issue( contract=call.node.contract_name, - function=call.node.function_name, + function_name=call.node.function_name, address=address, title="Message call to external contract", _type="Informational", description=description, + bytecode=state.environment.code.bytecode, swc_id=REENTRANCY, ) @@ -168,11 +170,12 @@ def execute(statespace): issue = Issue( contract=call.node.contract_name, - function=call.node.function_name, + function_name=call.node.function_name, address=address, title="State change after external call", _type="Warning", description=description, + bytecode=state.environment.code.bytecode, swc_id=REENTRANCY, ) issues.append(issue) diff --git a/mythril/analysis/modules/integer.py b/mythril/analysis/modules/integer.py index b5c952f8..c6f02936 100644 --- a/mythril/analysis/modules/integer.py +++ b/mythril/analysis/modules/integer.py @@ -91,9 +91,10 @@ def _check_integer_overflow(statespace, state, node): # Build issue issue = Issue( contract=node.contract_name, - function=node.function_name, + function_name=node.function_name, address=instruction["address"], swc_id=INTEGER_OVERFLOW_AND_UNDERFLOW, + bytecode=state.environment.code.bytecode, title="Integer Overflow", _type="Warning", ) @@ -198,15 +199,16 @@ def _check_integer_underflow(statespace, state, node): issue = Issue( contract=node.contract_name, - function=node.function_name, + function_name=node.function_name, address=instruction["address"], swc_id=INTEGER_OVERFLOW_AND_UNDERFLOW, + bytecode=state.environment.code.bytecode, title="Integer Underflow", _type="Warning", ) issue.description = ( - "The subtraction can result in an integer underflow.\n" + "The substraction can result in an integer underflow.\n" ) issue.debug = solver.pretty_print_model(model) diff --git a/mythril/analysis/modules/multiple_sends.py b/mythril/analysis/modules/multiple_sends.py index db7cca39..e26ddb90 100644 --- a/mythril/analysis/modules/multiple_sends.py +++ b/mythril/analysis/modules/multiple_sends.py @@ -24,9 +24,10 @@ def execute(statespace): instruction = call.state.get_current_instruction() issue = Issue( contract=node.contract_name, - function=node.function_name, + function_name=node.function_name, address=instruction["address"], swc_id=MULTIPLE_SENDS, + bytecode=call.state.environment.code.bytecode, title="Multiple Calls", _type="Informational", ) diff --git a/mythril/analysis/modules/suicide.py b/mythril/analysis/modules/suicide.py index eb7ab116..ebdd85da 100644 --- a/mythril/analysis/modules/suicide.py +++ b/mythril/analysis/modules/suicide.py @@ -9,7 +9,7 @@ import logging """ MODULE DESCRIPTION: -Check for SUICIDE instructions that either can be reached by anyone, or where msg.sender is checked against a tainted storage index +Check for SUICIDE instructions that either can be reached by anyone, or where msg.sender is checked against a tainted storage index (i.e. there's a write to that index is unconstrained by msg.sender). """ @@ -80,9 +80,10 @@ def _analyze_state(state, node): issue = Issue( contract=node.contract_name, - function=node.function_name, + function_name=node.function_name, address=instruction["address"], swc_id=UNPROTECTED_SELFDESTRUCT, + bytecode=state.environment.code.bytecode, title="Unchecked SUICIDE", _type="Warning", description=description, diff --git a/mythril/analysis/modules/transaction_order_dependence.py b/mythril/analysis/modules/transaction_order_dependence.py index 4528459c..8d98bfdb 100644 --- a/mythril/analysis/modules/transaction_order_dependence.py +++ b/mythril/analysis/modules/transaction_order_dependence.py @@ -34,15 +34,16 @@ def execute(statespace): instruction = call.state.get_current_instruction() issue = Issue( contract=node.contract_name, - function=node.function_name, + function_name=node.function_name, address=instruction["address"], title="Transaction order dependence", + bytecode=call.state.environment.code.bytecode, swc_id=TX_ORDER_DEPENDENCE, _type="Warning", ) 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/modules/unchecked_retval.py b/mythril/analysis/modules/unchecked_retval.py index 4effcbbe..3cbd800a 100644 --- a/mythril/analysis/modules/unchecked_retval.py +++ b/mythril/analysis/modules/unchecked_retval.py @@ -54,8 +54,9 @@ def execute(statespace): address = state.get_current_instruction()["address"] issue = Issue( contract=node.contract_name, - function=node.function_name, + function_name=node.function_name, address=address, + bytecode=state.environment.code.bytecode, title="Unchecked CALL return value", swc_id=UNCHECKED_RET_VAL, ) @@ -102,7 +103,8 @@ def execute(statespace): address = instr["address"] issue = Issue( contract=node.contract_name, - function=node.function_name, + function_name=node.function_name, + bytecode=state.environment.code.bytecode, address=address, title="Unchecked CALL return value", swc_id=UNCHECKED_RET_VAL, diff --git a/mythril/analysis/report.py b/mythril/analysis/report.py index 652d7d65..5d79bcf9 100644 --- a/mythril/analysis/report.py +++ b/mythril/analysis/report.py @@ -1,17 +1,19 @@ -import hashlib +import logging import json import operator from jinja2 import PackageLoader, Environment - +import sha3 +import hashlib class Issue: def __init__( self, contract, - function, + function_name, address, swc_id, title, + bytecode, _type="Informational", description="", debug="", @@ -19,7 +21,7 @@ class Issue: self.title = title self.contract = contract - self.function = function + self.function = function_name self.address = address self.description = description self.type = _type @@ -29,6 +31,14 @@ class Issue: self.code = None self.lineno = None + try: + keccak = sha3.keccak_256() + 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)) + self.bytecode_hash = "" + @property def as_dict(self): @@ -92,6 +102,20 @@ class Report: result = {"success": True, "error": None, "issues": self.sorted_issues()} return json.dumps(result, sort_keys=True) + def as_swc_standard_format(self): + """ Format defined for integration and correlation""" + result = { + "issues": [ + { + "swc-id": "SWC-{}".format(issue.swc_id), + "bytecodeOffset": issue.address, + "codeHash": issue.bytecode_hash, + } + for issue in self.issues.values() + ] + } + return json.dumps(result, sort_keys=True) + def as_markdown(self): filename = self._file_name() template = Report.environment.get_template("report_as_markdown.jinja2") diff --git a/mythril/disassembler/asm.py b/mythril/disassembler/asm.py new file mode 100644 index 00000000..762d1251 --- /dev/null +++ b/mythril/disassembler/asm.py @@ -0,0 +1,106 @@ +import re +from collections import Generator + +from ethereum.opcodes import opcodes + +regex_PUSH = re.compile("^PUSH(\d*)$") + +# Additional mnemonic to catch failed assertions +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 + self.argument = argument + + def to_dict(self) -> dict: + result = {"address": self.address, "opcode": self.op_code} + if self.argument: + result["argument"] = self.argument + return result + + +def instruction_list_to_easm(instruction_list: dict) -> str: + result = "" + + for instruction in instruction_list: + result += "{} {}".format(instruction["address"], instruction["opcode"]) + if "argument" in instruction: + result += " " + instruction["argument"] + result += "\n" + + return result + + +def get_opcode_from_name(operation_name: str) -> int: + for op_code, value in opcodes.items(): + if operation_name == value[0]: + return op_code + raise RuntimeError("Unknown opcode") + + +def find_op_code_sequence(pattern: list, instruction_list: list) -> Generator: + """ + Returns all indices in instruction_list that point to instruction sequences following a pattern + :param pattern: The pattern to look for. + Example: [["PUSH1", "PUSH2"], ["EQ"]] where ["PUSH1", "EQ"] satisfies the pattern + :param instruction_list: List of instructions to look in + :return: Indices to the instruction sequences + """ + for i in range(0, len(instruction_list) - len(pattern) + 1): + if is_sequence_match(pattern, instruction_list, i): + yield i + + +def is_sequence_match(pattern: list, instruction_list: list, index: int) -> bool: + """ + Checks if the instructions starting at index follow a pattern + :param pattern: List of lists describing a pattern. + Example: [["PUSH1", "PUSH2"], ["EQ"]] where ["PUSH1", "EQ"] satisfies the pattern + :param instruction_list: List of instructions + :param index: Index to check for + :return: Pattern matched + """ + for index, pattern_slot in enumerate(pattern, start=index): + try: + if not instruction_list[index]['opcode'] in pattern_slot: + return False + except IndexError: + return False + return True + + +def disassemble(bytecode: str) -> list: + """Disassembles evm bytecode and returns a list of instructions""" + instruction_list = [] + address = 0 + length = len(bytecode) + if "bzzr" in str(bytecode[-43:]): + # ignore swarm hash + length -= 43 + + while address < length: + try: + op_code = opcodes[bytecode[address]] + except KeyError: + instruction_list.append(EvmInstruction(address, "INVALID")) + address += 1 + continue + + op_code_name = op_code[0] + current_instruction = EvmInstruction(address, op_code_name) + + match = re.search(regex_PUSH, op_code_name) + if match: + argument_bytes = bytecode[address + 1: address + 1 + int(match.group(1))] + current_instruction.argument = "0x" + argument_bytes.hex() + address += int(match.group(1)) + + instruction_list.append(current_instruction) + address += 1 + + # We use a to_dict() here for compatibility reasons + return [element.to_dict() for element in instruction_list] diff --git a/mythril/ether/asm.py b/mythril/ether/asm.py deleted file mode 100644 index 4540bd72..00000000 --- a/mythril/ether/asm.py +++ /dev/null @@ -1,151 +0,0 @@ -import sys -import re -from ethereum.opcodes import opcodes -from mythril.ether import util - - -regex_PUSH = re.compile("^PUSH(\d*)$") - -# Additional mnemonic to catch failed assertions - -opcodes[254] = ["ASSERT_FAIL", 0, 0, 0] - - -def instruction_list_to_easm(instruction_list): - easm = "" - - for instruction in instruction_list: - - easm += str(instruction["address"]) + " " + instruction["opcode"] - - if "argument" in instruction: - easm += " " + instruction["argument"] - - easm += "\n" - - return easm - - -def easm_to_instruction_list(easm): - - regex_CODELINE = re.compile("^([A-Z0-9]+)(?:\s+([0-9a-fA-Fx]+))?$") - - instruction_list = [] - - codelines = easm.split("\n") - - for line in codelines: - - m = re.search(regex_CODELINE, line) - - if not m: - # Invalid code line - continue - - instruction = {"opcode": m.group(1)} - - if m.group(2): - instruction["argument"] = m.group(2)[2:] - - instruction_list.append(instruction) - - return instruction_list - - -def get_opcode_from_name(name): - - for opcode, value in opcodes.items(): - - if name == value[0]: - - return opcode - - raise RuntimeError("Unknown opcode") - - -def find_opcode_sequence(pattern, instruction_list): - match_indexes = [] - - pattern_length = len(pattern) - - for i in range(0, len(instruction_list) - pattern_length + 1): - - if instruction_list[i]["opcode"] in pattern[0]: - - matched = True - - for j in range(1, len(pattern)): - - if not (instruction_list[i + j]["opcode"] in pattern[j]): - matched = False - break - - if matched: - match_indexes.append(i) - - return match_indexes - - -def disassemble(bytecode): - - instruction_list = [] - addr = 0 - - length = len(bytecode) - - if "bzzr" in str(bytecode[-43:]): - # ignore swarm hash - length -= 43 - - while addr < length: - - instruction = {"address": addr} - - try: - if sys.version_info > (3, 0): - opcode = opcodes[bytecode[addr]] - else: - opcode = opcodes[ord(bytecode[addr])] - - except KeyError: - - # invalid opcode - instruction_list.append({"address": addr, "opcode": "INVALID"}) - addr += 1 - continue - - instruction["opcode"] = opcode[0] - - m = re.search(regex_PUSH, opcode[0]) - - if m: - argument = bytecode[addr + 1 : addr + 1 + int(m.group(1))] - instruction["argument"] = "0x" + argument.hex() - - addr += int(m.group(1)) - - instruction_list.append(instruction) - - addr += 1 - - return instruction_list - - -def assemble(instruction_list): - - bytecode = b"" - - for instruction in instruction_list: - - try: - opcode = get_opcode_from_name(instruction["opcode"]) - except RuntimeError: - opcode = 0xBB - - bytecode += opcode.to_bytes(1, byteorder="big") - - if "argument" in instruction: - - bytecode += util.safe_decode(instruction["argument"]) - - return bytecode diff --git a/mythril/version.py b/mythril/version.py index 72d9c8d0..dbb80403 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.12" # NOQA +VERSION="v0.18.13" # NOQA diff --git a/solidity_examples/rubixi.sol b/solidity_examples/rubixi.sol index 91fda1b6..301e9196 100644 --- a/solidity_examples/rubixi.sol +++ b/solidity_examples/rubixi.sol @@ -26,7 +26,7 @@ contract Rubixi { Participant[] private participants; //Fallback function - function() { + function() payable { init(); } diff --git a/tests/analysis/test_delegatecall.py b/tests/analysis/test_delegatecall.py index 72519d57..c9f1b660 100644 --- a/tests/analysis/test_delegatecall.py +++ b/tests/analysis/test_delegatecall.py @@ -15,8 +15,11 @@ import pytest_mock def test_concrete_call(): # arrange address = "0x10" + active_account = Account(address) + active_account.code = Disassembly("00") + environment = Environment(active_account, None, None, None, None, None) - state = GlobalState(None, None, None) + state = GlobalState(None, environment, None) state.mstate.memory = ["placeholder", "calldata_bling_0"] node = Node("example") @@ -50,7 +53,10 @@ def test_concrete_call_symbolic_to(): # arrange address = "0x10" - state = GlobalState(None, None, None) + active_account = Account(address) + active_account.code = Disassembly("00") + environment = Environment(active_account, None, None, None, None, None) + state = GlobalState(None, environment, None) state.mstate.memory = ["placeholder", "calldata_bling_0"] node = Node("example") @@ -98,10 +104,12 @@ def test_symbolic_call_storage_to(mocker): address = "0x10" active_account = Account(address) + active_account.code = Disassembly("00") environment = Environment(active_account, None, None, None, None, None) state = GlobalState(None, environment, None) state.mstate.memory = ["placeholder", "calldata_bling_0"] + node = Node("example") node.contract_name = "the contract name" node.function_name = "the function name" @@ -109,12 +117,14 @@ def test_symbolic_call_storage_to(mocker): to = Variable("storage_1", VarType.SYMBOLIC) call = Call(node, state, None, "Type: ", to, None) + mocker.patch.object(SymExecWrapper, "__init__", lambda x, y: None) statespace = SymExecWrapper(1) mocker.patch.object(statespace, "find_storage_write") statespace.find_storage_write.return_value = "Function name" + # act issues = _symbolic_call(call, state, address, statespace) @@ -137,9 +147,13 @@ def test_symbolic_call_calldata_to(mocker): # arrange address = "0x10" - state = GlobalState(None, None, None) + active_account = Account(address) + active_account.code = Disassembly("00") + environment = Environment(active_account, None, None, None, None, None) + state = GlobalState(None, environment, None) state.mstate.memory = ["placeholder", "calldata_bling_0"] + node = Node("example") node.contract_name = "the contract name" node.function_name = "the function name" @@ -147,12 +161,14 @@ def test_symbolic_call_calldata_to(mocker): to = Variable("calldata", VarType.SYMBOLIC) call = Call(node, state, None, "Type: ", to, None) + mocker.patch.object(SymExecWrapper, "__init__", lambda x, y: None) statespace = SymExecWrapper(1) - mocker.patch.object(statespace, "find_storage_write") + mocker.patch.object(statespace, 'find_storage_write') statespace.find_storage_write.return_value = "Function name" + # act issues = _symbolic_call(call, state, address, statespace) @@ -182,6 +198,8 @@ def test_delegate_call(sym_mock, concrete_mock, curr_instruction): curr_instruction.return_value = {"address": "0x10"} active_account = Account("0x10") + active_account.code = Disassembly("00") + environment = Environment(active_account, None, None, None, None, None) state = GlobalState(None, environment, Node) state.mstate.memory = ["placeholder", "calldata_bling_0"] diff --git a/tests/disassembler/asm.py b/tests/disassembler/asm.py new file mode 100644 index 00000000..960c27a9 --- /dev/null +++ b/tests/disassembler/asm.py @@ -0,0 +1,70 @@ +from mythril.disassembler.asm import * +import pytest + +valid_names = [("PUSH1", 0x60), ("STOP", 0x0), ("RETURN", 0xf3)] + + +@pytest.mark.parametrize("operation_name, hex_value", valid_names) +def test_get_opcode(operation_name: str, hex_value: int): + # Act + return_value = get_opcode_from_name(operation_name) + # Assert + assert return_value == hex_value + + +def test_get_unknown_opcode(): + operation_name = "definitely unknown" + + # Act + with pytest.raises(RuntimeError): + get_opcode_from_name(operation_name) + + +sequence_match_test_data = [ + # Normal no match + ((["PUSH1"], ["EQ"]), [{"opcode": "PUSH1"}, {"opcode": "PUSH3"}, {"opcode": "EQ"}], 1, False), + # Normal match + ((["PUSH1"], ["EQ"]), [{"opcode": "PUSH1"}, {"opcode": "PUSH1"}, {"opcode": "EQ"}], 1, True), + # Out of bounds pattern + ((["PUSH1"], ["EQ"]), [{"opcode": "PUSH1"}, {"opcode": "PUSH3"}, {"opcode": "EQ"}], 3, False), + ((["PUSH1"], ["EQ"]), [{"opcode": "PUSH1"}, {"opcode": "PUSH3"}, {"opcode": "EQ"}], 2, False), + # Double option match + ((["PUSH1", "PUSH3"], ["EQ"]), [{"opcode": "PUSH1"}, {"opcode": "PUSH1"}, {"opcode": "EQ"}], 1, True), + ((["PUSH1", "PUSH3"], ["EQ"]), [{"opcode": "PUSH1"}, {"opcode": "PUSH3"}, {"opcode": "EQ"}], 1, True), + # Double option no match + ((["PUSH1", "PUSH3"], ["EQ"]), [{"opcode": "PUSH1"}, {"opcode": "PUSH3"}, {"opcode": "EQ"}], 0, False), +] + + +@pytest.mark.parametrize("pattern, instruction_list, index, expected_result", sequence_match_test_data) +def test_is_sequence_match(pattern, instruction_list, index, expected_result): + # Act + return_value = is_sequence_match(pattern, instruction_list, index) + # Assert + assert return_value == expected_result + +find_sequence_match_test_data = [ + # Normal no match + ((["PUSH1"], ["EQ"]), [{"opcode": "PUSH1"}, {"opcode": "PUSH3"}, {"opcode": "EQ"}], []), + # Normal match + ((["PUSH1"], ["EQ"]), [{"opcode": "PUSH1"}, {"opcode": "PUSH1"}, {"opcode": "EQ"}, {"opcode": "PUSH1"}, {"opcode": "EQ"}], [1, 3]), +] + + +@pytest.mark.parametrize("pattern, instruction_list, expected_result", find_sequence_match_test_data) +def test_find_op_code_sequence(pattern, instruction_list, expected_result): + # Act + return_value = list(find_op_code_sequence(pattern, instruction_list)) + + # Assert + assert return_value == expected_result + + +def test_disassemble(): + # Act + instruction_list = disassemble(b"\x00\x16\x06") + + # Assert + assert instruction_list[0]["opcode"] == "STOP" + assert instruction_list[1]["opcode"] == "AND" + assert instruction_list[2]["opcode"] == "MOD" diff --git a/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_0.json b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_0.json new file mode 100644 index 00000000..1bfb0c2f --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_0.json @@ -0,0 +1,52 @@ +{ + "sha3_0" : { + "_info" : { + "comment" : "", + "filledwith" : "cpp-1.3.0+commit.6e0ce939.Linux.g++", + "lllcversion" : "Version: 0.4.18-develop.2017.9.25+commit.a72237f2.Linux.g++", + "source" : "src/VMTestsFiller/vmSha3Test/sha3_0Filler.json", + "sourceHash" : "843009e4e97d7dd905578ea884db6d80c07f57d58679ec181dc761e1e51ae035" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6000600020600055", + "data" : "0x", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x17487699b9", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6000600020600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6000600020600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_1.json b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_1.json new file mode 100644 index 00000000..0b2986d7 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_1.json @@ -0,0 +1,52 @@ +{ + "sha3_1" : { + "_info" : { + "comment" : "", + "filledwith" : "cpp-1.3.0+commit.6e0ce939.Linux.g++", + "lllcversion" : "Version: 0.4.18-develop.2017.9.25+commit.a72237f2.Linux.g++", + "source" : "src/VMTestsFiller/vmSha3Test/sha3_1Filler.json", + "sourceHash" : "5f786aded76570c96466f5a4c4632a5a0b362ffc1e4124667cdb1e9328d1d81d" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6005600420600055", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x013850", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6005600420600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0xc41589e7559804ea4a2080dad19d876a024ccb05117835447d72ce08c1d020ec" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6005600420600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_2.json b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_2.json new file mode 100644 index 00000000..b1e526af --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_2.json @@ -0,0 +1,52 @@ +{ + "sha3_2" : { + "_info" : { + "comment" : "", + "filledwith" : "cpp-1.3.0+commit.6e0ce939.Linux.g++", + "lllcversion" : "Version: 0.4.18-develop.2017.9.25+commit.a72237f2.Linux.g++", + "source" : "src/VMTestsFiller/vmSha3Test/sha3_2Filler.json", + "sourceHash" : "bb3f59dc995c834eaf315b4819900c30ba4e97ef60163aed05946c70e841691f" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x600a600a20600055", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x013850", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600a600a20600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x6bd2dd6bd408cbee33429358bf24fdc64612fbf8b1b4db604518f40ffd34b607" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600a600a20600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_3.json b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_3.json new file mode 100644 index 00000000..447b0cd0 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_3.json @@ -0,0 +1,37 @@ +{ + "sha3_3" : { + "_info" : { + "comment" : "", + "filledwith" : "cpp-1.3.0+commit.6e0ce939.Linux.g++", + "lllcversion" : "Version: 0.4.18-develop.2017.9.25+commit.a72237f2.Linux.g++", + "source" : "src/VMTestsFiller/vmSha3Test/sha3_3Filler.json", + "sourceHash" : "1f474f7dac8971615e641354d809db332975d1ea5ca589d855fb02a1da559033" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x620fffff6103e820600055", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x620fffff6103e820600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_4.json b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_4.json new file mode 100644 index 00000000..265cbbfa --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_4.json @@ -0,0 +1,37 @@ +{ + "sha3_4" : { + "_info" : { + "comment" : "", + "filledwith" : "cpp-1.3.0+commit.6e0ce939.Linux.g++", + "lllcversion" : "Version: 0.4.18-develop.2017.9.25+commit.a72237f2.Linux.g++", + "source" : "src/VMTestsFiller/vmSha3Test/sha3_4Filler.json", + "sourceHash" : "100da75ff0b63159ca86aa4ef7457a956027af5c6c1ed1f0fa894aaa63849887" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6064640fffffffff20600055", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6064640fffffffff20600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_5.json b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_5.json new file mode 100644 index 00000000..86d87942 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_5.json @@ -0,0 +1,37 @@ +{ + "sha3_5" : { + "_info" : { + "comment" : "", + "filledwith" : "cpp-1.3.0+commit.6e0ce939.Linux.g++", + "lllcversion" : "Version: 0.4.18-develop.2017.9.25+commit.a72237f2.Linux.g++", + "source" : "src/VMTestsFiller/vmSha3Test/sha3_5Filler.json", + "sourceHash" : "066bcf3a8e9e7b4c15ec2240c8e1bb0d53de0230c76989e21e4b6aaac83f577d" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x640fffffffff61271020600055", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x640fffffffff61271020600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_6.json b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_6.json new file mode 100644 index 00000000..97a6788e --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_6.json @@ -0,0 +1,37 @@ +{ + "sha3_6" : { + "_info" : { + "comment" : "", + "filledwith" : "cpp-1.3.0+commit.6e0ce939.Linux.g++", + "lllcversion" : "Version: 0.4.18-develop.2017.9.25+commit.a72237f2.Linux.g++", + "source" : "src/VMTestsFiller/vmSha3Test/sha3_6Filler.json", + "sourceHash" : "c360c6583bf965674d153f11c243c1e0807e95e99bc9bcb684a7ad2c7155dd40" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff20600055", + "data" : "0x", + "gas" : "0x0186a0", + "gasPrice" : "0x5af3107a4000", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff20600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_bigOffset.json b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_bigOffset.json new file mode 100644 index 00000000..940cff9b --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_bigOffset.json @@ -0,0 +1,37 @@ +{ + "sha3_bigOffset" : { + "_info" : { + "comment" : "", + "filledwith" : "cpp-1.3.0+commit.6e0ce939.Linux.g++", + "lllcversion" : "Version: 0.4.18-develop.2017.9.25+commit.a72237f2.Linux.g++", + "source" : "src/VMTestsFiller/vmSha3Test/sha3_bigOffsetFiller.json", + "sourceHash" : "1ae2cdfa2e3ab1cac89d8b3d535c3ee50601ebc6098fdbddadca74980eec6382" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60027e0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff20600055", + "data" : "0x", + "gas" : "0x010000000000", + "gasPrice" : "0x01", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "code" : "0x60027e0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff20600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_bigOffset2.json b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_bigOffset2.json new file mode 100644 index 00000000..d5ab8ebc --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_bigOffset2.json @@ -0,0 +1,52 @@ +{ + "sha3_bigOffset2" : { + "_info" : { + "comment" : "", + "filledwith" : "cpp-1.3.0+commit.6e0ce939.Linux.g++", + "lllcversion" : "Version: 0.4.18-develop.2017.9.25+commit.a72237f2.Linux.g++", + "source" : "src/VMTestsFiller/vmSha3Test/sha3_bigOffset2Filler.json", + "sourceHash" : "2bf8d14886b1001b266c29bd9f9e764f7e6965e851bfe1440e536735fca993dc" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6002630100000020600055", + "data" : "0x", + "gas" : "0x0100000000", + "gasPrice" : "0x01", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + }, + "gas" : "0xdfe7a9b0", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "code" : "0x6002630100000020600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x54a8c0ab653c15bfb48b47fd011ba2b9617af01cb45cab344acd57c924d56798" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "code" : "0x6002630100000020600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_bigSize.json b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_bigSize.json new file mode 100644 index 00000000..b859b929 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_bigSize.json @@ -0,0 +1,37 @@ +{ + "sha3_bigSize" : { + "_info" : { + "comment" : "", + "filledwith" : "cpp-1.3.0+commit.6e0ce939.Linux.g++", + "lllcversion" : "Version: 0.4.18-develop.2017.9.25+commit.a72237f2.Linux.g++", + "source" : "src/VMTestsFiller/vmSha3Test/sha3_bigSizeFiller.json", + "sourceHash" : "571bfd9a15c6b0e317f96a92f745aee1d800aa4486c1a101b3e016120ffb5415" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff20600055", + "data" : "0x", + "gas" : "0x010000000000", + "gasPrice" : "0x01", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "code" : "0x7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff20600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeNoQuadraticCost31.json b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeNoQuadraticCost31.json new file mode 100644 index 00000000..8d6caa4a --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeNoQuadraticCost31.json @@ -0,0 +1,52 @@ +{ + "sha3_memSizeNoQuadraticCost31" : { + "_info" : { + "comment" : "", + "filledwith" : "cpp-1.3.0+commit.6e0ce939.Linux.g++", + "lllcversion" : "Version: 0.4.18-develop.2017.9.25+commit.a72237f2.Linux.g++", + "source" : "src/VMTestsFiller/vmSha3Test/sha3_memSizeNoQuadraticCost31Filler.json", + "sourceHash" : "04553284981ef7338bdeac0e029652313a2643169833e386ca34bfa3d5e5942a" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60016103c020600055", + "data" : "0x", + "gas" : "0x0100000000", + "gasPrice" : "0x01", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + }, + "gas" : "0xffffb155", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "code" : "0x60016103c020600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0xbc36789e7a1e281436464229828f817d6612f7b477d66591ff96a9e064bcc98a" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "code" : "0x60016103c020600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeQuadraticCost32.json b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeQuadraticCost32.json new file mode 100644 index 00000000..6374c1cc --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeQuadraticCost32.json @@ -0,0 +1,52 @@ +{ + "sha3_memSizeQuadraticCost32" : { + "_info" : { + "comment" : "", + "filledwith" : "cpp-1.3.0+commit.6e0ce939.Linux.g++", + "lllcversion" : "Version: 0.4.18-develop.2017.9.25+commit.a72237f2.Linux.g++", + "source" : "src/VMTestsFiller/vmSha3Test/sha3_memSizeQuadraticCost32Filler.json", + "sourceHash" : "70f68e0328222cc2c995bf932f2f8f65f5d4c7e9f040a51bbf4dae3cad9110cf" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60016103e020600055", + "data" : "0x", + "gas" : "0x0100000000", + "gasPrice" : "0x01", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + }, + "gas" : "0xffffb151", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "code" : "0x60016103e020600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0xbc36789e7a1e281436464229828f817d6612f7b477d66591ff96a9e064bcc98a" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "code" : "0x60016103e020600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeQuadraticCost32_zeroSize.json b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeQuadraticCost32_zeroSize.json new file mode 100644 index 00000000..fb0c70dc --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeQuadraticCost32_zeroSize.json @@ -0,0 +1,52 @@ +{ + "sha3_memSizeQuadraticCost32_zeroSize" : { + "_info" : { + "comment" : "", + "filledwith" : "cpp-1.3.0+commit.6e0ce939.Linux.g++", + "lllcversion" : "Version: 0.4.18-develop.2017.9.25+commit.a72237f2.Linux.g++", + "source" : "src/VMTestsFiller/vmSha3Test/sha3_memSizeQuadraticCost32_zeroSizeFiller.json", + "sourceHash" : "96094eee3e3fcd478fe3780ff053e64bf5391616bfdc6c2017bf12dcc5d30366" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x600061040020600055", + "data" : "0x", + "gas" : "0x0100000000", + "gasPrice" : "0x01", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + }, + "gas" : "0xffffb1b9", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "code" : "0x600061040020600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "code" : "0x600061040020600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeQuadraticCost33.json b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeQuadraticCost33.json new file mode 100644 index 00000000..71034990 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeQuadraticCost33.json @@ -0,0 +1,52 @@ +{ + "sha3_memSizeQuadraticCost33" : { + "_info" : { + "comment" : "", + "filledwith" : "cpp-1.3.0+commit.6e0ce939.Linux.g++", + "lllcversion" : "Version: 0.4.18-develop.2017.9.25+commit.a72237f2.Linux.g++", + "source" : "src/VMTestsFiller/vmSha3Test/sha3_memSizeQuadraticCost33Filler.json", + "sourceHash" : "2fc9e00a7759c4271b6897b285ae437f6484281e9113e82a8252afbe16e85841" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x600161040020600055", + "data" : "0x", + "gas" : "0x0100000000", + "gasPrice" : "0x01", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + }, + "gas" : "0xffffb14e", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "code" : "0x600161040020600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0xbc36789e7a1e281436464229828f817d6612f7b477d66591ff96a9e064bcc98a" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "code" : "0x600161040020600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeQuadraticCost63.json b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeQuadraticCost63.json new file mode 100644 index 00000000..a32d5cdd --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeQuadraticCost63.json @@ -0,0 +1,52 @@ +{ + "sha3_memSizeQuadraticCost63" : { + "_info" : { + "comment" : "", + "filledwith" : "cpp-1.3.0+commit.6e0ce939.Linux.g++", + "lllcversion" : "Version: 0.4.18-develop.2017.9.25+commit.a72237f2.Linux.g++", + "source" : "src/VMTestsFiller/vmSha3Test/sha3_memSizeQuadraticCost63Filler.json", + "sourceHash" : "b81dd9fc94929d24f6a06dac81abb0099b969086ecf83326ecb4d6c98fc36f39" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60016107c020600055", + "data" : "0x", + "gas" : "0x0100000000", + "gasPrice" : "0x01", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + }, + "gas" : "0xffffb0ef", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "code" : "0x60016107c020600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0xbc36789e7a1e281436464229828f817d6612f7b477d66591ff96a9e064bcc98a" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "code" : "0x60016107c020600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeQuadraticCost64.json b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeQuadraticCost64.json new file mode 100644 index 00000000..d9ea26cc --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeQuadraticCost64.json @@ -0,0 +1,52 @@ +{ + "sha3_memSizeQuadraticCost64" : { + "_info" : { + "comment" : "", + "filledwith" : "cpp-1.3.0+commit.6e0ce939.Linux.g++", + "lllcversion" : "Version: 0.4.18-develop.2017.9.25+commit.a72237f2.Linux.g++", + "source" : "src/VMTestsFiller/vmSha3Test/sha3_memSizeQuadraticCost64Filler.json", + "sourceHash" : "9f1ae20cc7b481e84732b835af1d284c815d79a470ceb1094f0cf9e765a64b8d" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60016107e020600055", + "data" : "0x", + "gas" : "0x0100000000", + "gasPrice" : "0x01", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + }, + "gas" : "0xffffb0eb", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "code" : "0x60016107e020600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0xbc36789e7a1e281436464229828f817d6612f7b477d66591ff96a9e064bcc98a" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "code" : "0x60016107e020600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeQuadraticCost64_2.json b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeQuadraticCost64_2.json new file mode 100644 index 00000000..b7dc0bc3 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeQuadraticCost64_2.json @@ -0,0 +1,52 @@ +{ + "sha3_memSizeQuadraticCost64_2" : { + "_info" : { + "comment" : "", + "filledwith" : "cpp-1.3.0+commit.6e0ce939.Linux.g++", + "lllcversion" : "Version: 0.4.18-develop.2017.9.25+commit.a72237f2.Linux.g++", + "source" : "src/VMTestsFiller/vmSha3Test/sha3_memSizeQuadraticCost64_2Filler.json", + "sourceHash" : "4d313aaddd74f092eae5089cce1aef3aadc74b019f617fdf24acedd8fb26300b" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60206107e020600055", + "data" : "0x", + "gas" : "0x0100000000", + "gasPrice" : "0x01", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + }, + "gas" : "0xffffb0eb", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "code" : "0x60206107e020600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "code" : "0x60206107e020600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeQuadraticCost65.json b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeQuadraticCost65.json new file mode 100644 index 00000000..733a1776 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeQuadraticCost65.json @@ -0,0 +1,52 @@ +{ + "sha3_memSizeQuadraticCost65" : { + "_info" : { + "comment" : "", + "filledwith" : "cpp-1.3.0+commit.6e0ce939.Linux.g++", + "lllcversion" : "Version: 0.4.18-develop.2017.9.25+commit.a72237f2.Linux.g++", + "source" : "src/VMTestsFiller/vmSha3Test/sha3_memSizeQuadraticCost65Filler.json", + "sourceHash" : "28d6ebfb32dd2c00c629fe373fe58fd83466484d6022cd476ca63981ffaa950a" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x600161080020600055", + "data" : "0x", + "gas" : "0x0100000000", + "gasPrice" : "0x01", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + }, + "gas" : "0xffffb0e8", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "code" : "0x600161080020600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0xbc36789e7a1e281436464229828f817d6612f7b477d66591ff96a9e064bcc98a" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "code" : "0x600161080020600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/evm_test.py b/tests/laser/evm_testsuite/evm_test.py index 5bab5e45..9e251924 100644 --- a/tests/laser/evm_testsuite/evm_test.py +++ b/tests/laser/evm_testsuite/evm_test.py @@ -63,6 +63,11 @@ def test_vmtest( # Act laser_evm.time = datetime.now() + + # TODO: move this line below and check for VmExceptions when gas has been implemented + if post_condition == {}: + return + execute_message_call( laser_evm, callee_address=action["address"], @@ -77,10 +82,7 @@ def test_vmtest( # Assert - if post_condition != {}: - assert len(laser_evm.open_states) == 1 - else: - return + assert len(laser_evm.open_states) == 1 world_state = laser_evm.open_states[0] model = get_model(next(iter(laser_evm.nodes.values())).states[0].mstate.constraints) diff --git a/tests/testdata/outputs_expected/calls.sol.o.graph.html b/tests/testdata/outputs_expected/calls.sol.o.graph.html index 1e131531..0884c542 100644 --- a/tests/testdata/outputs_expected/calls.sol.o.graph.html +++ b/tests/testdata/outputs_expected/calls.sol.o.graph.html @@ -59,4 +59,4 @@ }); - \ No newline at end of file + diff --git a/tests/testdata/outputs_expected/environments.sol.o.graph.html b/tests/testdata/outputs_expected/environments.sol.o.graph.html index bc273a9e..14a02195 100644 --- a/tests/testdata/outputs_expected/environments.sol.o.graph.html +++ b/tests/testdata/outputs_expected/environments.sol.o.graph.html @@ -59,4 +59,4 @@ }); - \ No newline at end of file + diff --git a/tests/testdata/outputs_expected/environments.sol.o.json b/tests/testdata/outputs_expected/environments.sol.o.json index 20d5d5be..207b9a02 100644 --- a/tests/testdata/outputs_expected/environments.sol.o.json +++ b/tests/testdata/outputs_expected/environments.sol.o.json @@ -1 +1 @@ -{"error": null, "issues": [{"address": 158, "contract": "Unknown", "debug": "", "description": "A possible integer overflow exists in the function `_function_0x83f12fec`.\nThe addition or multiplication may result in a value higher than the maximum representable integer.", "function": "_function_0x83f12fec", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}, {"address": 278, "contract": "Unknown", "debug": "", "description": "A possible integer overflow exists in the function `_function_0x83f12fec`.\nThe addition or multiplication may result in a value higher than the maximum representable integer.", "function": "_function_0x83f12fec", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}, {"address": 378, "contract": "Unknown", "debug": "", "description": "A possible integer underflow exists in the function `_function_0x83f12fec`.\nThe subtraction may result in a value < 0.", "function": "_function_0x83f12fec", "swc_id": "101", "title": "Integer Underflow", "type": "Warning"}], "success": true} \ No newline at end of file +{"error": null, "issues": [{"address": 158, "contract": "Unknown", "debug": "", "description": "The arithmetic operation can result in integer overflow.\n", "function": "_function_0x83f12fec", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}, {"address": 278, "contract": "Unknown", "debug": "", "description": "The arithmetic operation can result in integer overflow.\n", "function": "_function_0x83f12fec", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}, {"address": 378, "contract": "Unknown", "debug": "", "description": "The substraction can result in an integer underflow.\n", "function": "_function_0x83f12fec", "swc_id": "101", "title": "Integer Underflow", "type": "Warning"}], "success": true} \ No newline at end of file diff --git a/tests/testdata/outputs_expected/environments.sol.o.markdown b/tests/testdata/outputs_expected/environments.sol.o.markdown index 201f8882..c9630745 100644 --- a/tests/testdata/outputs_expected/environments.sol.o.markdown +++ b/tests/testdata/outputs_expected/environments.sol.o.markdown @@ -9,8 +9,7 @@ ### Description -A possible integer overflow exists in the function `_function_0x83f12fec`. -The addition or multiplication may result in a value higher than the maximum representable integer. +The arithmetic operation can result in integer overflow. ## Integer Overflow - SWC ID: 101 @@ -21,8 +20,7 @@ The addition or multiplication may result in a value higher than the maximum rep ### Description -A possible integer overflow exists in the function `_function_0x83f12fec`. -The addition or multiplication may result in a value higher than the maximum representable integer. +The arithmetic operation can result in integer overflow. ## Integer Underflow - SWC ID: 101 @@ -33,5 +31,4 @@ The addition or multiplication may result in a value higher than the maximum rep ### Description -A possible integer underflow exists in the function `_function_0x83f12fec`. -The subtraction may result in a value < 0. +The substraction can result in an integer underflow. diff --git a/tests/testdata/outputs_expected/environments.sol.o.text b/tests/testdata/outputs_expected/environments.sol.o.text index 6adfb9a6..ef673002 100644 --- a/tests/testdata/outputs_expected/environments.sol.o.text +++ b/tests/testdata/outputs_expected/environments.sol.o.text @@ -4,8 +4,8 @@ Type: Warning Contract: Unknown Function name: _function_0x83f12fec PC address: 158 -A possible integer overflow exists in the function `_function_0x83f12fec`. -The addition or multiplication may result in a value higher than the maximum representable integer. +The arithmetic operation can result in integer overflow. + -------------------- ==== Integer Overflow ==== @@ -14,8 +14,8 @@ Type: Warning Contract: Unknown Function name: _function_0x83f12fec PC address: 278 -A possible integer overflow exists in the function `_function_0x83f12fec`. -The addition or multiplication may result in a value higher than the maximum representable integer. +The arithmetic operation can result in integer overflow. + -------------------- ==== Integer Underflow ==== @@ -24,7 +24,7 @@ Type: Warning Contract: Unknown Function name: _function_0x83f12fec PC address: 378 -A possible integer underflow exists in the function `_function_0x83f12fec`. -The subtraction may result in a value < 0. +The substraction can result in an integer underflow. + -------------------- diff --git a/tests/testdata/outputs_expected/ether_send.sol.o.graph.html b/tests/testdata/outputs_expected/ether_send.sol.o.graph.html index dbd5387a..45e1d97a 100644 --- a/tests/testdata/outputs_expected/ether_send.sol.o.graph.html +++ b/tests/testdata/outputs_expected/ether_send.sol.o.graph.html @@ -59,4 +59,4 @@ }); - \ No newline at end of file + diff --git a/tests/testdata/outputs_expected/ether_send.sol.o.json b/tests/testdata/outputs_expected/ether_send.sol.o.json index da2d8d12..03d3f2d6 100644 --- a/tests/testdata/outputs_expected/ether_send.sol.o.json +++ b/tests/testdata/outputs_expected/ether_send.sol.o.json @@ -1 +1 @@ -{"error": null, "issues": [{"address": 722, "contract": "Unknown", "debug": "", "description": "It seems that an attacker is able to execute an call instruction, this can mean that the attacker is able to extract funds out of the contract.", "function": "withdrawfunds()", "swc_id": "105", "title": "Ether send", "type": "Warning"}, {"address": 883, "contract": "Unknown", "debug": "", "description": "The arithmetic operation can result in integer overflow.\n", "function": "invest()", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}], "success": true} \ No newline at end of file +{"error": null, "issues": [{"address": 722, "contract": "Unknown", "debug": "", "description": "It seems that an attacker is able to execute an call instruction, this can mean that the attacker is able to extract funds out of the contract.", "function": "withdrawfunds()", "swc_id": "105", "title": "Ether send", "type": "Warning"}, {"address": 883, "contract": "Unknown", "debug": "", "description": "The arithmetic operation can result in integer overflow.\n", "function": "invest()", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}], "success": true} diff --git a/tests/testdata/outputs_expected/exceptions.sol.o.graph.html b/tests/testdata/outputs_expected/exceptions.sol.o.graph.html index c9f9356e..874f4164 100644 --- a/tests/testdata/outputs_expected/exceptions.sol.o.graph.html +++ b/tests/testdata/outputs_expected/exceptions.sol.o.graph.html @@ -59,4 +59,4 @@ }); - \ No newline at end of file + diff --git a/tests/testdata/outputs_expected/kinds_of_calls.sol.o.graph.html b/tests/testdata/outputs_expected/kinds_of_calls.sol.o.graph.html index b7281833..afbd4fb1 100644 --- a/tests/testdata/outputs_expected/kinds_of_calls.sol.o.graph.html +++ b/tests/testdata/outputs_expected/kinds_of_calls.sol.o.graph.html @@ -59,4 +59,4 @@ }); - \ No newline at end of file + diff --git a/tests/testdata/outputs_expected/metacoin.sol.o.graph.html b/tests/testdata/outputs_expected/metacoin.sol.o.graph.html index 87302af0..6ee81b9c 100644 --- a/tests/testdata/outputs_expected/metacoin.sol.o.graph.html +++ b/tests/testdata/outputs_expected/metacoin.sol.o.graph.html @@ -59,4 +59,4 @@ }); - \ No newline at end of file + diff --git a/tests/testdata/outputs_expected/multi_contracts.sol.o.graph.html b/tests/testdata/outputs_expected/multi_contracts.sol.o.graph.html index 51431e2b..f52f87b4 100644 --- a/tests/testdata/outputs_expected/multi_contracts.sol.o.graph.html +++ b/tests/testdata/outputs_expected/multi_contracts.sol.o.graph.html @@ -59,4 +59,4 @@ }); - \ No newline at end of file + diff --git a/tests/testdata/outputs_expected/multi_contracts.sol.o.json b/tests/testdata/outputs_expected/multi_contracts.sol.o.json index 3a8a609a..d48f8f35 100644 --- a/tests/testdata/outputs_expected/multi_contracts.sol.o.json +++ b/tests/testdata/outputs_expected/multi_contracts.sol.o.json @@ -1 +1 @@ -{"error": null, "issues": [{"address": 142, "contract": "Unknown", "debug": "", "description": "It seems that an attacker is able to execute an call instruction, this can mean that the attacker is able to extract funds out of the contract.", "function": "_function_0x8a4068dd", "swc_id": "105", "title": "Ether send", "type": "Warning"}], "success": true} \ No newline at end of file +{"error": null, "issues": [{"address": 142, "contract": "Unknown", "debug": "", "description": "It seems that an attacker is able to execute an call instruction, this can mean that the attacker is able to extract funds out of the contract.", "function": "_function_0x8a4068dd", "swc_id": "105", "title": "Ether send", "type": "Warning"}], "success": true} diff --git a/tests/testdata/outputs_expected/nonascii.sol.o.graph.html b/tests/testdata/outputs_expected/nonascii.sol.o.graph.html index bfce08fb..505c7d42 100644 --- a/tests/testdata/outputs_expected/nonascii.sol.o.graph.html +++ b/tests/testdata/outputs_expected/nonascii.sol.o.graph.html @@ -59,4 +59,4 @@ }); - \ No newline at end of file + diff --git a/tests/testdata/outputs_expected/origin.sol.o.graph.html b/tests/testdata/outputs_expected/origin.sol.o.graph.html index 88665173..7ff40e7e 100644 --- a/tests/testdata/outputs_expected/origin.sol.o.graph.html +++ b/tests/testdata/outputs_expected/origin.sol.o.graph.html @@ -59,4 +59,4 @@ }); - \ No newline at end of file + diff --git a/tests/testdata/outputs_expected/outputs_current/calls.sol.o.graph.html b/tests/testdata/outputs_expected/outputs_current/calls.sol.o.graph.html index 1e131531..0884c542 100644 --- a/tests/testdata/outputs_expected/outputs_current/calls.sol.o.graph.html +++ b/tests/testdata/outputs_expected/outputs_current/calls.sol.o.graph.html @@ -59,4 +59,4 @@ }); - \ No newline at end of file + diff --git a/tests/testdata/outputs_expected/outputs_current/environments.sol.o.graph.html b/tests/testdata/outputs_expected/outputs_current/environments.sol.o.graph.html index bc273a9e..14a02195 100644 --- a/tests/testdata/outputs_expected/outputs_current/environments.sol.o.graph.html +++ b/tests/testdata/outputs_expected/outputs_current/environments.sol.o.graph.html @@ -59,4 +59,4 @@ }); - \ No newline at end of file + diff --git a/tests/testdata/outputs_expected/outputs_current/environments.sol.o.json b/tests/testdata/outputs_expected/outputs_current/environments.sol.o.json new file mode 100644 index 00000000..207b9a02 --- /dev/null +++ b/tests/testdata/outputs_expected/outputs_current/environments.sol.o.json @@ -0,0 +1 @@ +{"error": null, "issues": [{"address": 158, "contract": "Unknown", "debug": "", "description": "The arithmetic operation can result in integer overflow.\n", "function": "_function_0x83f12fec", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}, {"address": 278, "contract": "Unknown", "debug": "", "description": "The arithmetic operation can result in integer overflow.\n", "function": "_function_0x83f12fec", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}, {"address": 378, "contract": "Unknown", "debug": "", "description": "The substraction can result in an integer underflow.\n", "function": "_function_0x83f12fec", "swc_id": "101", "title": "Integer Underflow", "type": "Warning"}], "success": true} \ No newline at end of file diff --git a/tests/testdata/outputs_expected/outputs_current/environments.sol.o.markdown b/tests/testdata/outputs_expected/outputs_current/environments.sol.o.markdown new file mode 100644 index 00000000..c9630745 --- /dev/null +++ b/tests/testdata/outputs_expected/outputs_current/environments.sol.o.markdown @@ -0,0 +1,34 @@ +# Analysis results for test-filename.sol + +## Integer Overflow +- SWC ID: 101 +- Type: Warning +- Contract: Unknown +- Function name: `_function_0x83f12fec` +- PC address: 158 + +### Description + +The arithmetic operation can result in integer overflow. + +## Integer Overflow +- SWC ID: 101 +- Type: Warning +- Contract: Unknown +- Function name: `_function_0x83f12fec` +- PC address: 278 + +### Description + +The arithmetic operation can result in integer overflow. + +## Integer Underflow +- SWC ID: 101 +- Type: Warning +- Contract: Unknown +- Function name: `_function_0x83f12fec` +- PC address: 378 + +### Description + +The substraction can result in an integer underflow. diff --git a/tests/testdata/outputs_expected/outputs_current/environments.sol.o.text b/tests/testdata/outputs_expected/outputs_current/environments.sol.o.text new file mode 100644 index 00000000..ef673002 --- /dev/null +++ b/tests/testdata/outputs_expected/outputs_current/environments.sol.o.text @@ -0,0 +1,30 @@ +==== Integer Overflow ==== +SWC ID: 101 +Type: Warning +Contract: Unknown +Function name: _function_0x83f12fec +PC address: 158 +The arithmetic operation can result in integer overflow. + +-------------------- + +==== Integer Overflow ==== +SWC ID: 101 +Type: Warning +Contract: Unknown +Function name: _function_0x83f12fec +PC address: 278 +The arithmetic operation can result in integer overflow. + +-------------------- + +==== Integer Underflow ==== +SWC ID: 101 +Type: Warning +Contract: Unknown +Function name: _function_0x83f12fec +PC address: 378 +The substraction can result in an integer underflow. + +-------------------- + diff --git a/tests/testdata/outputs_expected/outputs_current/ether_send.sol.o.graph.html b/tests/testdata/outputs_expected/outputs_current/ether_send.sol.o.graph.html index dbd5387a..45e1d97a 100644 --- a/tests/testdata/outputs_expected/outputs_current/ether_send.sol.o.graph.html +++ b/tests/testdata/outputs_expected/outputs_current/ether_send.sol.o.graph.html @@ -59,4 +59,4 @@ }); - \ No newline at end of file + diff --git a/tests/testdata/outputs_expected/outputs_current/ether_send.sol.o.json b/tests/testdata/outputs_expected/outputs_current/ether_send.sol.o.json index da2d8d12..03d3f2d6 100644 --- a/tests/testdata/outputs_expected/outputs_current/ether_send.sol.o.json +++ b/tests/testdata/outputs_expected/outputs_current/ether_send.sol.o.json @@ -1 +1 @@ -{"error": null, "issues": [{"address": 722, "contract": "Unknown", "debug": "", "description": "It seems that an attacker is able to execute an call instruction, this can mean that the attacker is able to extract funds out of the contract.", "function": "withdrawfunds()", "swc_id": "105", "title": "Ether send", "type": "Warning"}, {"address": 883, "contract": "Unknown", "debug": "", "description": "The arithmetic operation can result in integer overflow.\n", "function": "invest()", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}], "success": true} \ No newline at end of file +{"error": null, "issues": [{"address": 722, "contract": "Unknown", "debug": "", "description": "It seems that an attacker is able to execute an call instruction, this can mean that the attacker is able to extract funds out of the contract.", "function": "withdrawfunds()", "swc_id": "105", "title": "Ether send", "type": "Warning"}, {"address": 883, "contract": "Unknown", "debug": "", "description": "The arithmetic operation can result in integer overflow.\n", "function": "invest()", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}], "success": true} diff --git a/tests/testdata/outputs_expected/outputs_current/exceptions.sol.o.graph.html b/tests/testdata/outputs_expected/outputs_current/exceptions.sol.o.graph.html index c9f9356e..874f4164 100644 --- a/tests/testdata/outputs_expected/outputs_current/exceptions.sol.o.graph.html +++ b/tests/testdata/outputs_expected/outputs_current/exceptions.sol.o.graph.html @@ -59,4 +59,4 @@ }); - \ No newline at end of file + diff --git a/tests/testdata/outputs_expected/outputs_current/kinds_of_calls.sol.o.graph.html b/tests/testdata/outputs_expected/outputs_current/kinds_of_calls.sol.o.graph.html index b7281833..afbd4fb1 100644 --- a/tests/testdata/outputs_expected/outputs_current/kinds_of_calls.sol.o.graph.html +++ b/tests/testdata/outputs_expected/outputs_current/kinds_of_calls.sol.o.graph.html @@ -59,4 +59,4 @@ }); - \ No newline at end of file + diff --git a/tests/testdata/outputs_expected/outputs_current/metacoin.sol.o.graph.html b/tests/testdata/outputs_expected/outputs_current/metacoin.sol.o.graph.html index 87302af0..6ee81b9c 100644 --- a/tests/testdata/outputs_expected/outputs_current/metacoin.sol.o.graph.html +++ b/tests/testdata/outputs_expected/outputs_current/metacoin.sol.o.graph.html @@ -59,4 +59,4 @@ }); - \ No newline at end of file + diff --git a/tests/testdata/outputs_expected/outputs_current/multi_contracts.sol.o.graph.html b/tests/testdata/outputs_expected/outputs_current/multi_contracts.sol.o.graph.html index 51431e2b..f52f87b4 100644 --- a/tests/testdata/outputs_expected/outputs_current/multi_contracts.sol.o.graph.html +++ b/tests/testdata/outputs_expected/outputs_current/multi_contracts.sol.o.graph.html @@ -59,4 +59,4 @@ }); - \ No newline at end of file + diff --git a/tests/testdata/outputs_expected/outputs_current/multi_contracts.sol.o.json b/tests/testdata/outputs_expected/outputs_current/multi_contracts.sol.o.json index 3a8a609a..d48f8f35 100644 --- a/tests/testdata/outputs_expected/outputs_current/multi_contracts.sol.o.json +++ b/tests/testdata/outputs_expected/outputs_current/multi_contracts.sol.o.json @@ -1 +1 @@ -{"error": null, "issues": [{"address": 142, "contract": "Unknown", "debug": "", "description": "It seems that an attacker is able to execute an call instruction, this can mean that the attacker is able to extract funds out of the contract.", "function": "_function_0x8a4068dd", "swc_id": "105", "title": "Ether send", "type": "Warning"}], "success": true} \ No newline at end of file +{"error": null, "issues": [{"address": 142, "contract": "Unknown", "debug": "", "description": "It seems that an attacker is able to execute an call instruction, this can mean that the attacker is able to extract funds out of the contract.", "function": "_function_0x8a4068dd", "swc_id": "105", "title": "Ether send", "type": "Warning"}], "success": true} diff --git a/tests/testdata/outputs_expected/outputs_current/nonascii.sol.o.graph.html b/tests/testdata/outputs_expected/outputs_current/nonascii.sol.o.graph.html index bfce08fb..505c7d42 100644 --- a/tests/testdata/outputs_expected/outputs_current/nonascii.sol.o.graph.html +++ b/tests/testdata/outputs_expected/outputs_current/nonascii.sol.o.graph.html @@ -59,4 +59,4 @@ }); - \ No newline at end of file + diff --git a/tests/testdata/outputs_expected/outputs_current/origin.sol.o.graph.html b/tests/testdata/outputs_expected/outputs_current/origin.sol.o.graph.html index 88665173..7ff40e7e 100644 --- a/tests/testdata/outputs_expected/outputs_current/origin.sol.o.graph.html +++ b/tests/testdata/outputs_expected/outputs_current/origin.sol.o.graph.html @@ -59,4 +59,4 @@ }); - \ No newline at end of file + diff --git a/tests/testdata/outputs_expected/outputs_current/overflow.sol.o.graph.html b/tests/testdata/outputs_expected/outputs_current/overflow.sol.o.graph.html index 188273ad..70210177 100644 --- a/tests/testdata/outputs_expected/outputs_current/overflow.sol.o.graph.html +++ b/tests/testdata/outputs_expected/outputs_current/overflow.sol.o.graph.html @@ -59,4 +59,4 @@ }); - \ No newline at end of file + diff --git a/tests/testdata/outputs_expected/outputs_current/overflow.sol.o.json b/tests/testdata/outputs_expected/outputs_current/overflow.sol.o.json index d651908c..d794122d 100644 --- a/tests/testdata/outputs_expected/outputs_current/overflow.sol.o.json +++ b/tests/testdata/outputs_expected/outputs_current/overflow.sol.o.json @@ -1 +1 @@ -{"error": null, "issues": [{"address": 567, "contract": "Unknown", "debug": "", "description": "The subtraction can result in an integer underflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Underflow", "type": "Warning"}, {"address": 649, "contract": "Unknown", "debug": "", "description": "The subtraction can result in an integer underflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Underflow", "type": "Warning"}, {"address": 725, "contract": "Unknown", "debug": "", "description": "The arithmetic operation can result in integer overflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}], "success": true} \ No newline at end of file +{"error": null, "issues": [{"address": 567, "contract": "Unknown", "debug": "", "description": "The subtraction can result in an integer underflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Underflow", "type": "Warning"}, {"address": 649, "contract": "Unknown", "debug": "", "description": "The subtraction can result in an integer underflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Underflow", "type": "Warning"}, {"address": 725, "contract": "Unknown", "debug": "", "description": "The arithmetic operation can result in integer overflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}], "success": true} diff --git a/tests/testdata/outputs_expected/outputs_current/overflow.sol.o.text b/tests/testdata/outputs_expected/outputs_current/overflow.sol.o.text index ad480ffd..acdce40b 100644 --- a/tests/testdata/outputs_expected/outputs_current/overflow.sol.o.text +++ b/tests/testdata/outputs_expected/outputs_current/overflow.sol.o.text @@ -4,7 +4,7 @@ Type: Warning Contract: Unknown Function name: sendeth(address,uint256) PC address: 567 -The subtraction can result in an integer underflow. +The substraction can result in an integer underflow. -------------------- @@ -14,7 +14,7 @@ Type: Warning Contract: Unknown Function name: sendeth(address,uint256) PC address: 649 -The subtraction can result in an integer underflow. +The substraction can result in an integer underflow. -------------------- diff --git a/tests/testdata/outputs_expected/outputs_current/returnvalue.sol.o.graph.html b/tests/testdata/outputs_expected/outputs_current/returnvalue.sol.o.graph.html index 759f6b55..278fa213 100644 --- a/tests/testdata/outputs_expected/outputs_current/returnvalue.sol.o.graph.html +++ b/tests/testdata/outputs_expected/outputs_current/returnvalue.sol.o.graph.html @@ -59,4 +59,4 @@ }); - \ No newline at end of file + diff --git a/tests/testdata/outputs_expected/outputs_current/suicide.sol.o.graph.html b/tests/testdata/outputs_expected/outputs_current/suicide.sol.o.graph.html index 173d77ea..12a3306d 100644 --- a/tests/testdata/outputs_expected/outputs_current/suicide.sol.o.graph.html +++ b/tests/testdata/outputs_expected/outputs_current/suicide.sol.o.graph.html @@ -59,4 +59,4 @@ }); - \ No newline at end of file + diff --git a/tests/testdata/outputs_expected/outputs_current/underflow.sol.o.graph.html b/tests/testdata/outputs_expected/outputs_current/underflow.sol.o.graph.html index 767cda13..6e6b4f7a 100644 --- a/tests/testdata/outputs_expected/outputs_current/underflow.sol.o.graph.html +++ b/tests/testdata/outputs_expected/outputs_current/underflow.sol.o.graph.html @@ -59,4 +59,4 @@ }); - \ No newline at end of file + diff --git a/tests/testdata/outputs_expected/outputs_current/underflow.sol.o.json b/tests/testdata/outputs_expected/outputs_current/underflow.sol.o.json index d651908c..d794122d 100644 --- a/tests/testdata/outputs_expected/outputs_current/underflow.sol.o.json +++ b/tests/testdata/outputs_expected/outputs_current/underflow.sol.o.json @@ -1 +1 @@ -{"error": null, "issues": [{"address": 567, "contract": "Unknown", "debug": "", "description": "The subtraction can result in an integer underflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Underflow", "type": "Warning"}, {"address": 649, "contract": "Unknown", "debug": "", "description": "The subtraction can result in an integer underflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Underflow", "type": "Warning"}, {"address": 725, "contract": "Unknown", "debug": "", "description": "The arithmetic operation can result in integer overflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}], "success": true} \ No newline at end of file +{"error": null, "issues": [{"address": 567, "contract": "Unknown", "debug": "", "description": "The subtraction can result in an integer underflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Underflow", "type": "Warning"}, {"address": 649, "contract": "Unknown", "debug": "", "description": "The subtraction can result in an integer underflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Underflow", "type": "Warning"}, {"address": 725, "contract": "Unknown", "debug": "", "description": "The arithmetic operation can result in integer overflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}], "success": true} diff --git a/tests/testdata/outputs_expected/overflow.sol.o.graph.html b/tests/testdata/outputs_expected/overflow.sol.o.graph.html index 188273ad..70210177 100644 --- a/tests/testdata/outputs_expected/overflow.sol.o.graph.html +++ b/tests/testdata/outputs_expected/overflow.sol.o.graph.html @@ -59,4 +59,4 @@ }); - \ No newline at end of file + diff --git a/tests/testdata/outputs_expected/overflow.sol.o.json b/tests/testdata/outputs_expected/overflow.sol.o.json index d651908c..d794122d 100644 --- a/tests/testdata/outputs_expected/overflow.sol.o.json +++ b/tests/testdata/outputs_expected/overflow.sol.o.json @@ -1 +1 @@ -{"error": null, "issues": [{"address": 567, "contract": "Unknown", "debug": "", "description": "The subtraction can result in an integer underflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Underflow", "type": "Warning"}, {"address": 649, "contract": "Unknown", "debug": "", "description": "The subtraction can result in an integer underflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Underflow", "type": "Warning"}, {"address": 725, "contract": "Unknown", "debug": "", "description": "The arithmetic operation can result in integer overflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}], "success": true} \ No newline at end of file +{"error": null, "issues": [{"address": 567, "contract": "Unknown", "debug": "", "description": "The subtraction can result in an integer underflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Underflow", "type": "Warning"}, {"address": 649, "contract": "Unknown", "debug": "", "description": "The subtraction can result in an integer underflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Underflow", "type": "Warning"}, {"address": 725, "contract": "Unknown", "debug": "", "description": "The arithmetic operation can result in integer overflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}], "success": true} diff --git a/tests/testdata/outputs_expected/returnvalue.sol.o.graph.html b/tests/testdata/outputs_expected/returnvalue.sol.o.graph.html index 759f6b55..278fa213 100644 --- a/tests/testdata/outputs_expected/returnvalue.sol.o.graph.html +++ b/tests/testdata/outputs_expected/returnvalue.sol.o.graph.html @@ -59,4 +59,4 @@ }); - \ No newline at end of file + diff --git a/tests/testdata/outputs_expected/suicide.sol.o.graph.html b/tests/testdata/outputs_expected/suicide.sol.o.graph.html index 173d77ea..12a3306d 100644 --- a/tests/testdata/outputs_expected/suicide.sol.o.graph.html +++ b/tests/testdata/outputs_expected/suicide.sol.o.graph.html @@ -59,4 +59,4 @@ }); - \ No newline at end of file + diff --git a/tests/testdata/outputs_expected/underflow.sol.o.graph.html b/tests/testdata/outputs_expected/underflow.sol.o.graph.html index 767cda13..6e6b4f7a 100644 --- a/tests/testdata/outputs_expected/underflow.sol.o.graph.html +++ b/tests/testdata/outputs_expected/underflow.sol.o.graph.html @@ -59,4 +59,4 @@ }); - \ No newline at end of file + diff --git a/tests/testdata/outputs_expected/underflow.sol.o.json b/tests/testdata/outputs_expected/underflow.sol.o.json index d651908c..d794122d 100644 --- a/tests/testdata/outputs_expected/underflow.sol.o.json +++ b/tests/testdata/outputs_expected/underflow.sol.o.json @@ -1 +1 @@ -{"error": null, "issues": [{"address": 567, "contract": "Unknown", "debug": "", "description": "The subtraction can result in an integer underflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Underflow", "type": "Warning"}, {"address": 649, "contract": "Unknown", "debug": "", "description": "The subtraction can result in an integer underflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Underflow", "type": "Warning"}, {"address": 725, "contract": "Unknown", "debug": "", "description": "The arithmetic operation can result in integer overflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}], "success": true} \ No newline at end of file +{"error": null, "issues": [{"address": 567, "contract": "Unknown", "debug": "", "description": "The subtraction can result in an integer underflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Underflow", "type": "Warning"}, {"address": 649, "contract": "Unknown", "debug": "", "description": "The subtraction can result in an integer underflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Underflow", "type": "Warning"}, {"address": 725, "contract": "Unknown", "debug": "", "description": "The arithmetic operation can result in integer overflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}], "success": true}