Merge remote-tracking branch 'upstream/master' into merge_master

pull/635/head
Joran Honig 6 years ago
commit c8e4aef7cd
  1. 6
      mythril/analysis/modules/delegatecall.py
  2. 9
      mythril/analysis/modules/dependence_on_predictable_vars.py
  3. 3
      mythril/analysis/modules/deprecated_ops.py
  4. 3
      mythril/analysis/modules/ether_send.py
  5. 5
      mythril/analysis/modules/exceptions.py
  6. 9
      mythril/analysis/modules/external_calls.py
  7. 8
      mythril/analysis/modules/integer.py
  8. 3
      mythril/analysis/modules/multiple_sends.py
  9. 5
      mythril/analysis/modules/suicide.py
  10. 5
      mythril/analysis/modules/transaction_order_dependence.py
  11. 6
      mythril/analysis/modules/unchecked_retval.py
  12. 32
      mythril/analysis/report.py
  13. 106
      mythril/disassembler/asm.py
  14. 151
      mythril/ether/asm.py
  15. 2
      mythril/version.py
  16. 2
      solidity_examples/rubixi.sol
  17. 26
      tests/analysis/test_delegatecall.py
  18. 70
      tests/disassembler/asm.py
  19. 52
      tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_0.json
  20. 52
      tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_1.json
  21. 52
      tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_2.json
  22. 37
      tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_3.json
  23. 37
      tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_4.json
  24. 37
      tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_5.json
  25. 37
      tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_6.json
  26. 37
      tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_bigOffset.json
  27. 52
      tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_bigOffset2.json
  28. 37
      tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_bigSize.json
  29. 52
      tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeNoQuadraticCost31.json
  30. 52
      tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeQuadraticCost32.json
  31. 52
      tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeQuadraticCost32_zeroSize.json
  32. 52
      tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeQuadraticCost33.json
  33. 52
      tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeQuadraticCost63.json
  34. 52
      tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeQuadraticCost64.json
  35. 52
      tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeQuadraticCost64_2.json
  36. 52
      tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_memSizeQuadraticCost65.json
  37. 10
      tests/laser/evm_testsuite/evm_test.py
  38. 2
      tests/testdata/outputs_expected/calls.sol.o.graph.html
  39. 2
      tests/testdata/outputs_expected/environments.sol.o.graph.html
  40. 2
      tests/testdata/outputs_expected/environments.sol.o.json
  41. 9
      tests/testdata/outputs_expected/environments.sol.o.markdown
  42. 12
      tests/testdata/outputs_expected/environments.sol.o.text
  43. 2
      tests/testdata/outputs_expected/ether_send.sol.o.graph.html
  44. 2
      tests/testdata/outputs_expected/ether_send.sol.o.json
  45. 2
      tests/testdata/outputs_expected/exceptions.sol.o.graph.html
  46. 2
      tests/testdata/outputs_expected/kinds_of_calls.sol.o.graph.html
  47. 2
      tests/testdata/outputs_expected/metacoin.sol.o.graph.html
  48. 2
      tests/testdata/outputs_expected/multi_contracts.sol.o.graph.html
  49. 2
      tests/testdata/outputs_expected/multi_contracts.sol.o.json
  50. 2
      tests/testdata/outputs_expected/nonascii.sol.o.graph.html
  51. 2
      tests/testdata/outputs_expected/origin.sol.o.graph.html
  52. 2
      tests/testdata/outputs_expected/outputs_current/calls.sol.o.graph.html
  53. 2
      tests/testdata/outputs_expected/outputs_current/environments.sol.o.graph.html
  54. 1
      tests/testdata/outputs_expected/outputs_current/environments.sol.o.json
  55. 34
      tests/testdata/outputs_expected/outputs_current/environments.sol.o.markdown
  56. 30
      tests/testdata/outputs_expected/outputs_current/environments.sol.o.text
  57. 2
      tests/testdata/outputs_expected/outputs_current/ether_send.sol.o.graph.html
  58. 2
      tests/testdata/outputs_expected/outputs_current/ether_send.sol.o.json
  59. 2
      tests/testdata/outputs_expected/outputs_current/exceptions.sol.o.graph.html
  60. 2
      tests/testdata/outputs_expected/outputs_current/kinds_of_calls.sol.o.graph.html
  61. 2
      tests/testdata/outputs_expected/outputs_current/metacoin.sol.o.graph.html
  62. 2
      tests/testdata/outputs_expected/outputs_current/multi_contracts.sol.o.graph.html
  63. 2
      tests/testdata/outputs_expected/outputs_current/multi_contracts.sol.o.json
  64. 2
      tests/testdata/outputs_expected/outputs_current/nonascii.sol.o.graph.html
  65. 2
      tests/testdata/outputs_expected/outputs_current/origin.sol.o.graph.html
  66. 2
      tests/testdata/outputs_expected/outputs_current/overflow.sol.o.graph.html
  67. 2
      tests/testdata/outputs_expected/outputs_current/overflow.sol.o.json
  68. 4
      tests/testdata/outputs_expected/outputs_current/overflow.sol.o.text
  69. 2
      tests/testdata/outputs_expected/outputs_current/returnvalue.sol.o.graph.html
  70. 2
      tests/testdata/outputs_expected/outputs_current/suicide.sol.o.graph.html
  71. 2
      tests/testdata/outputs_expected/outputs_current/underflow.sol.o.graph.html
  72. 2
      tests/testdata/outputs_expected/outputs_current/underflow.sol.o.json
  73. 2
      tests/testdata/outputs_expected/overflow.sol.o.graph.html
  74. 2
      tests/testdata/outputs_expected/overflow.sol.o.json
  75. 2
      tests/testdata/outputs_expected/returnvalue.sol.o.graph.html
  76. 2
      tests/testdata/outputs_expected/suicide.sol.o.graph.html
  77. 2
      tests/testdata/outputs_expected/underflow.sol.o.graph.html
  78. 2
      tests/testdata/outputs_expected/underflow.sol.o.json

@ -46,9 +46,10 @@ def _concrete_call(call, state, address, meminstart):
issue = Issue( issue = Issue(
contract=call.node.contract_name, contract=call.node.contract_name,
function=call.node.function_name, function_name=call.node.function_name,
address=address, address=address,
swc_id=DELEGATECALL_TO_UNTRUSTED_CONTRACT, swc_id=DELEGATECALL_TO_UNTRUSTED_CONTRACT,
bytecode=state.environment.code.bytecode,
title="Call data forwarded with delegatecall()", title="Call data forwarded with delegatecall()",
_type="Informational", _type="Informational",
) )
@ -68,9 +69,10 @@ def _concrete_call(call, state, address, meminstart):
def _symbolic_call(call, state, address, statespace): def _symbolic_call(call, state, address, statespace):
issue = Issue( issue = Issue(
contract=call.node.contract_name, contract=call.node.contract_name,
function=call.node.function_name, function_name=call.node.function_name,
address=address, address=address,
swc_id=DELEGATECALL_TO_UNTRUSTED_CONTRACT, swc_id=DELEGATECALL_TO_UNTRUSTED_CONTRACT,
bytecode=state.environment.code.bytecode,
title=call.type + " to a user-supplied address", title=call.type + " to a user-supplied address",
) )

@ -63,9 +63,10 @@ def execute(statespace):
) )
issue = Issue( issue = Issue(
contract=call.node.contract_name, contract=call.node.contract_name,
function=call.node.function_name, function_name=call.node.function_name,
address=address, address=address,
swc_id=swc_type, swc_id=swc_type,
bytecode=state.environment.code.bytecode,
title="Dependence on predictable environment variable", title="Dependence on predictable environment variable",
_type="Warning", _type="Warning",
description=description, description=description,
@ -111,8 +112,9 @@ def execute(statespace):
issue = Issue( issue = Issue(
contract=call.node.contract_name, contract=call.node.contract_name,
function=call.node.function_name, function_name=call.node.function_name,
address=address, address=address,
bytecode=call.state.environment.code.bytecode,
title="Dependence on predictable variable", title="Dependence on predictable variable",
_type="Warning", _type="Warning",
description=description, description=description,
@ -140,8 +142,9 @@ def execute(statespace):
) )
issue = Issue( issue = Issue(
contract=call.node.contract_name, contract=call.node.contract_name,
function=call.node.function_name, function_name=call.node.function_name,
address=address, address=address,
bytecode=state.environment.code.bytecode,
title="Dependence on predictable variable", title="Dependence on predictable variable",
_type="Informational", _type="Informational",
description=description, description=description,

@ -34,9 +34,10 @@ def execute(statespace):
issue = Issue( issue = Issue(
contract=node.contract_name, contract=node.contract_name,
function=node.function_name, function_name=node.function_name,
address=instruction["address"], address=instruction["address"],
title="Use of tx.origin", title="Use of tx.origin",
bytecode=state.environment.code.bytecode,
_type="Warning", _type="Warning",
swc_id=TX_ORIGIN_USAGE, swc_id=TX_ORIGIN_USAGE,
description=description, description=description,

@ -60,11 +60,12 @@ def _analyze_state(state, node):
issue = Issue( issue = Issue(
contract=node.contract_name, contract=node.contract_name,
function=node.function_name, function_name=node.function_name,
address=instruction["address"], address=instruction["address"],
swc_id=UNPROTECTED_ETHER_WITHDRAWAL, swc_id=UNPROTECTED_ETHER_WITHDRAWAL,
title="Ether send", title="Ether send",
_type="Warning", _type="Warning",
bytecode=state.environment.code.bytecode,
description="It seems that an attacker is able to execute an call instruction," description="It seems that an attacker is able to execute an call instruction,"
" this can mean that the attacker is able to extract funds " " this can mean that the attacker is able to extract funds "
"out of the contract.".format(target), "out of the contract.".format(target),

@ -36,7 +36,7 @@ def execute(statespace):
"out-of-bounds array access, or assert violations. " "out-of-bounds array access, or assert violations. "
) )
description += ( 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. " "Use `require()` for regular input checking. "
) )
@ -49,12 +49,13 @@ def execute(statespace):
issues.append( issues.append(
Issue( Issue(
contract=node.contract_name, contract=node.contract_name,
function=node.function_name, function_name=node.function_name,
address=address, address=address,
swc_id=ASSERT_VIOLATION, swc_id=ASSERT_VIOLATION,
title="Exception state", title="Exception state",
_type="Informational", _type="Informational",
description=description, description=description,
bytecode=state.environment.code.bytecode,
debug=debug, debug=debug,
) )
) )

@ -115,11 +115,12 @@ def execute(statespace):
issue = Issue( issue = Issue(
contract=call.node.contract_name, contract=call.node.contract_name,
function=call.node.function_name, function_name=call.node.function_name,
address=address, address=address,
title="Message call to external contract", title="Message call to external contract",
_type="Warning", _type="Warning",
description=description, description=description,
bytecode=state.environment.code.bytecode,
swc_id=REENTRANCY, swc_id=REENTRANCY,
) )
@ -129,11 +130,12 @@ def execute(statespace):
issue = Issue( issue = Issue(
contract=call.node.contract_name, contract=call.node.contract_name,
function=call.node.function_name, function_name=call.node.function_name,
address=address, address=address,
title="Message call to external contract", title="Message call to external contract",
_type="Informational", _type="Informational",
description=description, description=description,
bytecode=state.environment.code.bytecode,
swc_id=REENTRANCY, swc_id=REENTRANCY,
) )
@ -168,11 +170,12 @@ def execute(statespace):
issue = Issue( issue = Issue(
contract=call.node.contract_name, contract=call.node.contract_name,
function=call.node.function_name, function_name=call.node.function_name,
address=address, address=address,
title="State change after external call", title="State change after external call",
_type="Warning", _type="Warning",
description=description, description=description,
bytecode=state.environment.code.bytecode,
swc_id=REENTRANCY, swc_id=REENTRANCY,
) )
issues.append(issue) issues.append(issue)

@ -91,9 +91,10 @@ def _check_integer_overflow(statespace, state, node):
# Build issue # Build issue
issue = Issue( issue = Issue(
contract=node.contract_name, contract=node.contract_name,
function=node.function_name, function_name=node.function_name,
address=instruction["address"], address=instruction["address"],
swc_id=INTEGER_OVERFLOW_AND_UNDERFLOW, swc_id=INTEGER_OVERFLOW_AND_UNDERFLOW,
bytecode=state.environment.code.bytecode,
title="Integer Overflow", title="Integer Overflow",
_type="Warning", _type="Warning",
) )
@ -198,15 +199,16 @@ def _check_integer_underflow(statespace, state, node):
issue = Issue( issue = Issue(
contract=node.contract_name, contract=node.contract_name,
function=node.function_name, function_name=node.function_name,
address=instruction["address"], address=instruction["address"],
swc_id=INTEGER_OVERFLOW_AND_UNDERFLOW, swc_id=INTEGER_OVERFLOW_AND_UNDERFLOW,
bytecode=state.environment.code.bytecode,
title="Integer Underflow", title="Integer Underflow",
_type="Warning", _type="Warning",
) )
issue.description = ( 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) issue.debug = solver.pretty_print_model(model)

@ -24,9 +24,10 @@ def execute(statespace):
instruction = call.state.get_current_instruction() instruction = call.state.get_current_instruction()
issue = Issue( issue = Issue(
contract=node.contract_name, contract=node.contract_name,
function=node.function_name, function_name=node.function_name,
address=instruction["address"], address=instruction["address"],
swc_id=MULTIPLE_SENDS, swc_id=MULTIPLE_SENDS,
bytecode=call.state.environment.code.bytecode,
title="Multiple Calls", title="Multiple Calls",
_type="Informational", _type="Informational",
) )

@ -9,7 +9,7 @@ import logging
""" """
MODULE DESCRIPTION: 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). (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( issue = Issue(
contract=node.contract_name, contract=node.contract_name,
function=node.function_name, function_name=node.function_name,
address=instruction["address"], address=instruction["address"],
swc_id=UNPROTECTED_SELFDESTRUCT, swc_id=UNPROTECTED_SELFDESTRUCT,
bytecode=state.environment.code.bytecode,
title="Unchecked SUICIDE", title="Unchecked SUICIDE",
_type="Warning", _type="Warning",
description=description, description=description,

@ -34,15 +34,16 @@ def execute(statespace):
instruction = call.state.get_current_instruction() instruction = call.state.get_current_instruction()
issue = Issue( issue = Issue(
contract=node.contract_name, contract=node.contract_name,
function=node.function_name, function_name=node.function_name,
address=instruction["address"], address=instruction["address"],
title="Transaction order dependence", title="Transaction order dependence",
bytecode=call.state.environment.code.bytecode,
swc_id=TX_ORDER_DEPENDENCE, swc_id=TX_ORDER_DEPENDENCE,
_type="Warning", _type="Warning",
) )
issue.description = ( 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" "direction of the call statement is determined from a tainted storage location"
) )
issues.append(issue) issues.append(issue)

@ -54,8 +54,9 @@ def execute(statespace):
address = state.get_current_instruction()["address"] address = state.get_current_instruction()["address"]
issue = Issue( issue = Issue(
contract=node.contract_name, contract=node.contract_name,
function=node.function_name, function_name=node.function_name,
address=address, address=address,
bytecode=state.environment.code.bytecode,
title="Unchecked CALL return value", title="Unchecked CALL return value",
swc_id=UNCHECKED_RET_VAL, swc_id=UNCHECKED_RET_VAL,
) )
@ -102,7 +103,8 @@ def execute(statespace):
address = instr["address"] address = instr["address"]
issue = Issue( issue = Issue(
contract=node.contract_name, contract=node.contract_name,
function=node.function_name, function_name=node.function_name,
bytecode=state.environment.code.bytecode,
address=address, address=address,
title="Unchecked CALL return value", title="Unchecked CALL return value",
swc_id=UNCHECKED_RET_VAL, swc_id=UNCHECKED_RET_VAL,

@ -1,17 +1,19 @@
import hashlib import logging
import json import json
import operator import operator
from jinja2 import PackageLoader, Environment from jinja2 import PackageLoader, Environment
import sha3
import hashlib
class Issue: class Issue:
def __init__( def __init__(
self, self,
contract, contract,
function, function_name,
address, address,
swc_id, swc_id,
title, title,
bytecode,
_type="Informational", _type="Informational",
description="", description="",
debug="", debug="",
@ -19,7 +21,7 @@ class Issue:
self.title = title self.title = title
self.contract = contract self.contract = contract
self.function = function self.function = function_name
self.address = address self.address = address
self.description = description self.description = description
self.type = _type self.type = _type
@ -29,6 +31,14 @@ class Issue:
self.code = None self.code = None
self.lineno = 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 @property
def as_dict(self): def as_dict(self):
@ -92,6 +102,20 @@ class Report:
result = {"success": True, "error": None, "issues": self.sorted_issues()} result = {"success": True, "error": None, "issues": self.sorted_issues()}
return json.dumps(result, sort_keys=True) 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): def as_markdown(self):
filename = self._file_name() filename = self._file_name()
template = Report.environment.get_template("report_as_markdown.jinja2") template = Report.environment.get_template("report_as_markdown.jinja2")

@ -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]

@ -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

@ -1,3 +1,3 @@
# This file is suitable for sourcing inside POSIX shell, e.g. bash as # This file is suitable for sourcing inside POSIX shell, e.g. bash as
# well as for importing into Python # well as for importing into Python
VERSION = "v0.18.12" # NOQA VERSION="v0.18.13" # NOQA

@ -26,7 +26,7 @@ contract Rubixi {
Participant[] private participants; Participant[] private participants;
//Fallback function //Fallback function
function() { function() payable {
init(); init();
} }

@ -15,8 +15,11 @@ import pytest_mock
def test_concrete_call(): def test_concrete_call():
# arrange # arrange
address = "0x10" 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"] state.mstate.memory = ["placeholder", "calldata_bling_0"]
node = Node("example") node = Node("example")
@ -50,7 +53,10 @@ def test_concrete_call_symbolic_to():
# arrange # arrange
address = "0x10" 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"] state.mstate.memory = ["placeholder", "calldata_bling_0"]
node = Node("example") node = Node("example")
@ -98,10 +104,12 @@ def test_symbolic_call_storage_to(mocker):
address = "0x10" address = "0x10"
active_account = Account(address) active_account = Account(address)
active_account.code = Disassembly("00")
environment = Environment(active_account, None, None, None, None, None) environment = Environment(active_account, None, None, None, None, None)
state = GlobalState(None, environment, None) state = GlobalState(None, environment, None)
state.mstate.memory = ["placeholder", "calldata_bling_0"] state.mstate.memory = ["placeholder", "calldata_bling_0"]
node = Node("example") node = Node("example")
node.contract_name = "the contract name" node.contract_name = "the contract name"
node.function_name = "the function name" node.function_name = "the function name"
@ -109,12 +117,14 @@ def test_symbolic_call_storage_to(mocker):
to = Variable("storage_1", VarType.SYMBOLIC) to = Variable("storage_1", VarType.SYMBOLIC)
call = Call(node, state, None, "Type: ", to, None) call = Call(node, state, None, "Type: ", to, None)
mocker.patch.object(SymExecWrapper, "__init__", lambda x, y: None) mocker.patch.object(SymExecWrapper, "__init__", lambda x, y: None)
statespace = SymExecWrapper(1) 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" statespace.find_storage_write.return_value = "Function name"
# act # act
issues = _symbolic_call(call, state, address, statespace) issues = _symbolic_call(call, state, address, statespace)
@ -137,9 +147,13 @@ def test_symbolic_call_calldata_to(mocker):
# arrange # arrange
address = "0x10" 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"] state.mstate.memory = ["placeholder", "calldata_bling_0"]
node = Node("example") node = Node("example")
node.contract_name = "the contract name" node.contract_name = "the contract name"
node.function_name = "the function name" node.function_name = "the function name"
@ -147,12 +161,14 @@ def test_symbolic_call_calldata_to(mocker):
to = Variable("calldata", VarType.SYMBOLIC) to = Variable("calldata", VarType.SYMBOLIC)
call = Call(node, state, None, "Type: ", to, None) call = Call(node, state, None, "Type: ", to, None)
mocker.patch.object(SymExecWrapper, "__init__", lambda x, y: None) mocker.patch.object(SymExecWrapper, "__init__", lambda x, y: None)
statespace = SymExecWrapper(1) 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" statespace.find_storage_write.return_value = "Function name"
# act # act
issues = _symbolic_call(call, state, address, statespace) 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"} curr_instruction.return_value = {"address": "0x10"}
active_account = Account("0x10") active_account = Account("0x10")
active_account.code = Disassembly("00")
environment = Environment(active_account, None, None, None, None, None) environment = Environment(active_account, None, None, None, None, None)
state = GlobalState(None, environment, Node) state = GlobalState(None, environment, Node)
state.mstate.memory = ["placeholder", "calldata_bling_0"] state.mstate.memory = ["placeholder", "calldata_bling_0"]

@ -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"

@ -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" : {
}
}
}
}
}

@ -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" : {
}
}
}
}
}

@ -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" : {
}
}
}
}
}

@ -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" : {
}
}
}
}
}

@ -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" : {
}
}
}
}
}

@ -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" : {
}
}
}
}
}

@ -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" : {
}
}
}
}
}

@ -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" : {
}
}
}
}
}

@ -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" : {
}
}
}
}
}

@ -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" : {
}
}
}
}
}

@ -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" : {
}
}
}
}
}

@ -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" : {
}
}
}
}
}

@ -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" : {
}
}
}
}
}

@ -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" : {
}
}
}
}
}

@ -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" : {
}
}
}
}
}

@ -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" : {
}
}
}
}
}

@ -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" : {
}
}
}
}
}

@ -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" : {
}
}
}
}
}

@ -63,6 +63,11 @@ def test_vmtest(
# Act # Act
laser_evm.time = datetime.now() 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( execute_message_call(
laser_evm, laser_evm,
callee_address=action["address"], callee_address=action["address"],
@ -77,10 +82,7 @@ def test_vmtest(
# Assert # Assert
if post_condition != {}: assert len(laser_evm.open_states) == 1
assert len(laser_evm.open_states) == 1
else:
return
world_state = laser_evm.open_states[0] world_state = laser_evm.open_states[0]
model = get_model(next(iter(laser_evm.nodes.values())).states[0].mstate.constraints) model = get_model(next(iter(laser_evm.nodes.values())).states[0].mstate.constraints)

@ -59,4 +59,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

@ -59,4 +59,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

@ -1 +1 @@
{"error": null, "issues": [{"address": 158, "contract": "Unknown", "debug": "<DEBUG-DATA>", "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": "<DEBUG-DATA>", "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": "<DEBUG-DATA>", "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} {"error": null, "issues": [{"address": 158, "contract": "Unknown", "debug": "<DEBUG-DATA>", "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": "<DEBUG-DATA>", "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": "<DEBUG-DATA>", "description": "The substraction can result in an integer underflow.\n", "function": "_function_0x83f12fec", "swc_id": "101", "title": "Integer Underflow", "type": "Warning"}], "success": true}

@ -9,8 +9,7 @@
### Description ### Description
A possible integer overflow exists in the function `_function_0x83f12fec`. The arithmetic operation can result in integer overflow.
The addition or multiplication may result in a value higher than the maximum representable integer.
## Integer Overflow ## Integer Overflow
- SWC ID: 101 - SWC ID: 101
@ -21,8 +20,7 @@ The addition or multiplication may result in a value higher than the maximum rep
### Description ### Description
A possible integer overflow exists in the function `_function_0x83f12fec`. The arithmetic operation can result in integer overflow.
The addition or multiplication may result in a value higher than the maximum representable integer.
## Integer Underflow ## Integer Underflow
- SWC ID: 101 - SWC ID: 101
@ -33,5 +31,4 @@ The addition or multiplication may result in a value higher than the maximum rep
### Description ### Description
A possible integer underflow exists in the function `_function_0x83f12fec`. The substraction can result in an integer underflow.
The subtraction may result in a value < 0.

@ -4,8 +4,8 @@ Type: Warning
Contract: Unknown Contract: Unknown
Function name: _function_0x83f12fec Function name: _function_0x83f12fec
PC address: 158 PC address: 158
A possible integer overflow exists in the function `_function_0x83f12fec`. The arithmetic operation can result in integer overflow.
The addition or multiplication may result in a value higher than the maximum representable integer.
-------------------- --------------------
==== Integer Overflow ==== ==== Integer Overflow ====
@ -14,8 +14,8 @@ Type: Warning
Contract: Unknown Contract: Unknown
Function name: _function_0x83f12fec Function name: _function_0x83f12fec
PC address: 278 PC address: 278
A possible integer overflow exists in the function `_function_0x83f12fec`. The arithmetic operation can result in integer overflow.
The addition or multiplication may result in a value higher than the maximum representable integer.
-------------------- --------------------
==== Integer Underflow ==== ==== Integer Underflow ====
@ -24,7 +24,7 @@ Type: Warning
Contract: Unknown Contract: Unknown
Function name: _function_0x83f12fec Function name: _function_0x83f12fec
PC address: 378 PC address: 378
A possible integer underflow exists in the function `_function_0x83f12fec`. The substraction can result in an integer underflow.
The subtraction may result in a value < 0.
-------------------- --------------------

@ -59,4 +59,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

@ -1 +1 @@
{"error": null, "issues": [{"address": 722, "contract": "Unknown", "debug": "<DEBUG-DATA>", "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": "<DEBUG-DATA>", "description": "The arithmetic operation can result in integer overflow.\n", "function": "invest()", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}], "success": true} {"error": null, "issues": [{"address": 722, "contract": "Unknown", "debug": "<DEBUG-DATA>", "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": "<DEBUG-DATA>", "description": "The arithmetic operation can result in integer overflow.\n", "function": "invest()", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}], "success": true}

@ -59,4 +59,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

@ -59,4 +59,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

@ -59,4 +59,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

@ -59,4 +59,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

@ -1 +1 @@
{"error": null, "issues": [{"address": 142, "contract": "Unknown", "debug": "<DEBUG-DATA>", "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} {"error": null, "issues": [{"address": 142, "contract": "Unknown", "debug": "<DEBUG-DATA>", "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}

@ -59,4 +59,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

@ -59,4 +59,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

@ -59,4 +59,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

@ -59,4 +59,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

@ -0,0 +1 @@
{"error": null, "issues": [{"address": 158, "contract": "Unknown", "debug": "<DEBUG-DATA>", "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": "<DEBUG-DATA>", "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": "<DEBUG-DATA>", "description": "The substraction can result in an integer underflow.\n", "function": "_function_0x83f12fec", "swc_id": "101", "title": "Integer Underflow", "type": "Warning"}], "success": true}

@ -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.

@ -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.
--------------------

@ -59,4 +59,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

@ -1 +1 @@
{"error": null, "issues": [{"address": 722, "contract": "Unknown", "debug": "<DEBUG-DATA>", "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": "<DEBUG-DATA>", "description": "The arithmetic operation can result in integer overflow.\n", "function": "invest()", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}], "success": true} {"error": null, "issues": [{"address": 722, "contract": "Unknown", "debug": "<DEBUG-DATA>", "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": "<DEBUG-DATA>", "description": "The arithmetic operation can result in integer overflow.\n", "function": "invest()", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}], "success": true}

@ -59,4 +59,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

@ -59,4 +59,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

@ -59,4 +59,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

@ -59,4 +59,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

@ -1 +1 @@
{"error": null, "issues": [{"address": 142, "contract": "Unknown", "debug": "<DEBUG-DATA>", "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} {"error": null, "issues": [{"address": 142, "contract": "Unknown", "debug": "<DEBUG-DATA>", "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}

@ -59,4 +59,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

@ -59,4 +59,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

@ -59,4 +59,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

@ -1 +1 @@
{"error": null, "issues": [{"address": 567, "contract": "Unknown", "debug": "<DEBUG-DATA>", "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": "<DEBUG-DATA>", "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": "<DEBUG-DATA>", "description": "The arithmetic operation can result in integer overflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}], "success": true} {"error": null, "issues": [{"address": 567, "contract": "Unknown", "debug": "<DEBUG-DATA>", "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": "<DEBUG-DATA>", "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": "<DEBUG-DATA>", "description": "The arithmetic operation can result in integer overflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}], "success": true}

@ -4,7 +4,7 @@ Type: Warning
Contract: Unknown Contract: Unknown
Function name: sendeth(address,uint256) Function name: sendeth(address,uint256)
PC address: 567 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 Contract: Unknown
Function name: sendeth(address,uint256) Function name: sendeth(address,uint256)
PC address: 649 PC address: 649
The subtraction can result in an integer underflow. The substraction can result in an integer underflow.
-------------------- --------------------

@ -59,4 +59,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

@ -59,4 +59,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

@ -59,4 +59,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

@ -1 +1 @@
{"error": null, "issues": [{"address": 567, "contract": "Unknown", "debug": "<DEBUG-DATA>", "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": "<DEBUG-DATA>", "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": "<DEBUG-DATA>", "description": "The arithmetic operation can result in integer overflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}], "success": true} {"error": null, "issues": [{"address": 567, "contract": "Unknown", "debug": "<DEBUG-DATA>", "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": "<DEBUG-DATA>", "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": "<DEBUG-DATA>", "description": "The arithmetic operation can result in integer overflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}], "success": true}

@ -59,4 +59,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

@ -1 +1 @@
{"error": null, "issues": [{"address": 567, "contract": "Unknown", "debug": "<DEBUG-DATA>", "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": "<DEBUG-DATA>", "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": "<DEBUG-DATA>", "description": "The arithmetic operation can result in integer overflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}], "success": true} {"error": null, "issues": [{"address": 567, "contract": "Unknown", "debug": "<DEBUG-DATA>", "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": "<DEBUG-DATA>", "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": "<DEBUG-DATA>", "description": "The arithmetic operation can result in integer overflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}], "success": true}

@ -59,4 +59,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

@ -59,4 +59,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

@ -59,4 +59,4 @@
}); });
</script> </script>
</body> </body>
</html> </html>

@ -1 +1 @@
{"error": null, "issues": [{"address": 567, "contract": "Unknown", "debug": "<DEBUG-DATA>", "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": "<DEBUG-DATA>", "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": "<DEBUG-DATA>", "description": "The arithmetic operation can result in integer overflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}], "success": true} {"error": null, "issues": [{"address": 567, "contract": "Unknown", "debug": "<DEBUG-DATA>", "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": "<DEBUG-DATA>", "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": "<DEBUG-DATA>", "description": "The arithmetic operation can result in integer overflow.\n", "function": "sendeth(address,uint256)", "swc_id": "101", "title": "Integer Overflow", "type": "Warning"}], "success": true}

Loading…
Cancel
Save