Merge pull request #699 from ConsenSys/develop

Merge for 0.19.4 release
pull/818/head
Bernhard Mueller 6 years ago committed by GitHub
commit 4b652d1ecb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      .github/ISSUE_TEMPLATE/analysis-module.md
  2. 2
      .github/ISSUE_TEMPLATE/bug-report.md
  3. 10
      .github/ISSUE_TEMPLATE/feature-request.md
  4. 47
      mythril/analysis/analysis_utils.py
  5. 4
      mythril/analysis/modules/dependence_on_predictable_vars.py
  6. 82
      mythril/analysis/modules/ether_send.py
  7. 93
      mythril/analysis/modules/ether_thief.py
  8. 2
      mythril/analysis/modules/external_calls.py
  9. 15
      mythril/analysis/modules/integer.py
  10. 15
      mythril/analysis/modules/suicide.py
  11. 2
      mythril/analysis/report.py
  12. 77
      mythril/analysis/solver.py
  13. 6
      mythril/analysis/symbolic.py
  14. 4
      mythril/analysis/templates/report_as_markdown.jinja2
  15. 4
      mythril/analysis/templates/report_as_text.jinja2
  16. 3
      mythril/ether/ethcontract.py
  17. 25
      mythril/ether/soliditycontract.py
  18. 28
      mythril/interfaces/cli.py
  19. 28
      mythril/laser/ethereum/call.py
  20. 19
      mythril/laser/ethereum/cfg.py
  21. 211
      mythril/laser/ethereum/instructions.py
  22. 6
      mythril/laser/ethereum/keccak.py
  23. 51
      mythril/laser/ethereum/natives.py
  24. 216
      mythril/laser/ethereum/state.py
  25. 10
      mythril/laser/ethereum/strategy/basic.py
  26. 101
      mythril/laser/ethereum/svm.py
  27. 62
      mythril/laser/ethereum/taint_analysis.py
  28. 6
      mythril/laser/ethereum/transaction/concolic.py
  29. 11
      mythril/laser/ethereum/transaction/symbolic.py
  30. 49
      mythril/laser/ethereum/transaction/transaction_models.py
  31. 42
      mythril/laser/ethereum/util.py
  32. 58
      mythril/mythril.py
  33. 16
      mythril/support/loader.py
  34. 73
      mythril/support/truffle.py
  35. 2
      mythril/version.py
  36. 2
      requirements.txt
  37. 2
      setup.py
  38. 2
      signatures.json
  39. 6
      tests/cmd_line_test.py
  40. 52
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/address0.json
  41. 52
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/address1.json
  42. 52
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy0.json
  43. 52
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy0_return.json
  44. 52
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy1.json
  45. 52
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy1_return.json
  46. 51
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy2.json
  47. 51
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy2_return.json
  48. 37
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopyUnderFlow.json
  49. 51
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopyZeroMemExpansion.json
  50. 51
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopyZeroMemExpansion_return.json
  51. 51
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy_DataIndexTooHigh.json
  52. 51
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy_DataIndexTooHigh2.json
  53. 51
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy_DataIndexTooHigh2_return.json
  54. 51
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy_DataIndexTooHigh_return.json
  55. 52
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy_sec.json
  56. 52
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataload0.json
  57. 52
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataload1.json
  58. 52
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataload2.json
  59. 51
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataloadSizeTooHigh.json
  60. 52
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataloadSizeTooHighPartial.json
  61. 51
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataload_BigOffset.json
  62. 52
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatasize0.json
  63. 52
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatasize1.json
  64. 52
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatasize2.json
  65. 52
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/caller.json
  66. 52
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/callvalue.json
  67. 52
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/codecopy0.json
  68. 51
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/codecopyZeroMemExpansion.json
  69. 51
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/codecopy_DataIndexTooHigh.json
  70. 52
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/codesize.json
  71. 52
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/gasprice.json
  72. 52
      tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/origin.json
  73. 24
      tests/laser/evm_testsuite/evm_test.py
  74. 30
      tests/laser/state/calldata_test.py
  75. 25
      tests/laser/transaction/symbolic_test.py
  76. 3
      tests/native_test.py
  77. 2
      tests/report_test.py
  78. 2
      tests/svm_test.py
  79. 2
      tests/testdata/outputs_expected/calls.sol.o.json
  80. 2
      tests/testdata/outputs_expected/environments.sol.o.json
  81. 6
      tests/testdata/outputs_expected/ether_send.sol.o.graph.html
  82. 2
      tests/testdata/outputs_expected/ether_send.sol.o.json
  83. 6
      tests/testdata/outputs_expected/ether_send.sol.o.markdown
  84. 6
      tests/testdata/outputs_expected/ether_send.sol.o.text
  85. 2
      tests/testdata/outputs_expected/exceptions.sol.o.json
  86. 2
      tests/testdata/outputs_expected/kinds_of_calls.sol.o.json
  87. 6
      tests/testdata/outputs_expected/multi_contracts.sol.o.graph.html
  88. 2
      tests/testdata/outputs_expected/multi_contracts.sol.o.json
  89. 4
      tests/testdata/outputs_expected/multi_contracts.sol.o.markdown
  90. 4
      tests/testdata/outputs_expected/multi_contracts.sol.o.text
  91. 2
      tests/testdata/outputs_expected/origin.sol.o.json
  92. 2
      tests/testdata/outputs_expected/overflow.sol.o.json
  93. 2
      tests/testdata/outputs_expected/overflow.sol.o.markdown
  94. 2
      tests/testdata/outputs_expected/overflow.sol.o.text
  95. 2
      tests/testdata/outputs_expected/returnvalue.sol.o.json
  96. 6
      tests/testdata/outputs_expected/suicide.sol.o.graph.html
  97. 2
      tests/testdata/outputs_expected/suicide.sol.o.json
  98. 6
      tests/testdata/outputs_expected/underflow.sol.o.graph.html
  99. 2
      tests/testdata/outputs_expected/underflow.sol.o.json
  100. 2
      tests/testdata/outputs_expected/underflow.sol.o.markdown
  101. Some files were not shown because too many files have changed in this diff Show More

@ -8,30 +8,29 @@ about: Create an analysis module feature request
## Description
<!-- Replace this text with a description of an vulnerability that should be
<!-- Add a description of an vulnerability that should be
detected by a Mythril analysis module. -->
## Tests
<!-- This section is optional.
Replace this text with suggestions on how to test the feature,
if it is not obvious. This might require certain Solidity source,
bytecode, or a Truffle project. You can also provide
links to existing code. -->
Suggest how to test the feature, if it is not obvious. This might
require certain Solidity source, bytecode, or a Truffle project. You
can also provide links to existing code. -->
## Implementation details
<!-- This section is optional.
If you have thoughts about how to implement the analysis, feel free
replace this text with that. -->
If you have thoughts about how to implement the analysis, add
this here. -->
## Links
<!-- This section is optional.
Replace this text with any links describing the issue or pointing to resources
that can help in implementing the analysis
Add links describing the issue or pointing to resources that can help
in implementing the analysis.
Thanks for helping! -->

@ -71,7 +71,7 @@ Please modify for your setup
<!-- This section is optional.
Add any other context about the problem here or special environment setup
Add any other context about the problem here or special environment setup.
Thanks for helping!

@ -6,7 +6,7 @@ about: Tell us about a new feature that would make Mythril better
## Description
<!-- Replace this text with a short description of the feature. -->
<!-- Give a short description of the feature. -->
## Background
@ -17,10 +17,10 @@ feature, for example: user scenarios, or the value of the feature. -->
<!-- This section is optional.
Replace this text with suggestions on how to test the feature,
if it is not obvious. This might require certain Solidity source,
bytecode, or a Truffle project. You can also provide
links to existing code.
Suggestion how to test the feature, if it is not obvious.
This might require certain Solidity source, bytecode, or a Truffle
project. You can also provide links to existing code.
Thanks for helping!

@ -0,0 +1,47 @@
import re
from typing import List
from z3 import *
from mythril.laser.ethereum.transaction import ContractCreationTransaction
from mythril.laser.ethereum.state import GlobalState
def get_non_creator_constraints(state: GlobalState) -> (List, bool):
"""
Get constraints which say that the caller isn't the creator of the contract
:param state: The state
:return: tuple of (constraints, bool) where the bool says whether the caller is constrained or not
"""
not_creator_constraints = []
creator = None
if isinstance(
state.world_state.transaction_sequence[0], ContractCreationTransaction
):
creator = state.world_state.transaction_sequence[0].caller
if creator is not None:
for transaction in state.world_state.transaction_sequence[1:]:
not_creator_constraints.append(
Not(Extract(159, 0, transaction.caller) == Extract(159, 0, creator))
)
not_creator_constraints.append(
Not(Extract(159, 0, transaction.caller) == 0)
)
else:
for transaction in state.world_state.transaction_sequence:
not_creator_constraints.append(
Not(Extract(159, 0, transaction.caller) == 0)
)
if not has_caller_check_constraint(state.mstate.constraints):
return [], True
return not_creator_constraints, False
def has_caller_check_constraint(constraints: List) -> bool:
"""
Checks whether the caller is constrained to a value or not
"""
for constraint in constraints:
if re.search(r"caller", str(constraint)) and re.search(
r"[0-9]{20}", str(constraint)
):
return False
return True

@ -48,7 +48,7 @@ def execute(statespace):
found = []
for var in vars:
for constraint in call.node.constraints + [call.to]:
for constraint in call.node.constraints[:] + [call.to]:
if var in str(constraint):
found.append(var)
@ -75,7 +75,7 @@ def execute(statespace):
# Second check: blockhash
for constraint in call.node.constraints + [call.to]:
for constraint in call.node.constraints[:] + [call.to]:
if "blockhash" in str(constraint):
description = "In the function `" + call.node.function_name + "` "
if "number" in str(constraint):

@ -1,82 +0,0 @@
from mythril.analysis.ops import *
from mythril.analysis import solver
from mythril.analysis.report import Issue
from mythril.analysis.swc_data import UNPROTECTED_ETHER_WITHDRAWAL
from mythril.exceptions import UnsatError
import logging
"""
MODULE DESCRIPTION:
Check for CALLs that send >0 Ether to either the transaction sender, or to an address provided as a function argument.
If msg.sender is checked against a value in storage, check whether that storage index is tainted (i.e. there's an unconstrained write
to that index).
"""
def execute(state_space):
logging.debug("Executing module: ETHER_SEND")
issues = []
for k in state_space.nodes:
node = state_space.nodes[k]
for state in node.states:
issues += _analyze_state(state, node)
return issues
def _analyze_state(state, node):
issues = []
instruction = state.get_current_instruction()
if instruction["opcode"] != "CALL":
return []
call_value = state.mstate.stack[-3]
target = state.mstate.stack[-2]
not_creator_constraints = []
if len(state.world_state.transaction_sequence) > 1:
creator = state.world_state.transaction_sequence[0].caller
for transaction in state.world_state.transaction_sequence[1:]:
not_creator_constraints.append(
Not(Extract(159, 0, transaction.caller) == Extract(159, 0, creator))
)
not_creator_constraints.append(
Not(Extract(159, 0, transaction.caller) == 0)
)
try:
model = solver.get_model(
node.constraints + not_creator_constraints + [call_value > 0]
)
debug = "Transaction Sequence: " + str(
solver.get_transaction_sequence(
state, node.constraints + not_creator_constraints + [call_value > 0]
)
)
issue = Issue(
contract=node.contract_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),
debug=debug,
)
issues.append(issue)
except UnsatError:
logging.debug("[UNCHECKED_SUICIDE] no model found")
return issues

@ -0,0 +1,93 @@
from mythril.analysis.ops import *
from mythril.analysis import solver
from mythril.analysis.analysis_utils import get_non_creator_constraints
from mythril.analysis.report import Issue
from mythril.analysis.swc_data import UNPROTECTED_ETHER_WITHDRAWAL
from mythril.exceptions import UnsatError
import logging
"""
MODULE DESCRIPTION:
Search for cases where Ether can be withdrawn to a user-specified address.
An issue is reported ONLY IF:
- The transaction sender does not match contract creator;
- The sender has not previously sent any ETH to the contract account.
This is somewhat coarse and needs to be refined in the future.
"""
def execute(state_space):
logging.debug("Executing module: ETHER_THIEF")
issues = []
for k in state_space.nodes:
node = state_space.nodes[k]
for state in node.states:
issues += _analyze_state(state, node)
return issues
def _analyze_state(state, node):
issues = []
instruction = state.get_current_instruction()
if instruction["opcode"] != "CALL":
return []
call_value = state.mstate.stack[-3]
target = state.mstate.stack[-2]
not_creator_constraints, constrained = get_non_creator_constraints(state)
if constrained:
return []
try:
"""
FIXME: Instead of solving for call_value > 0, check whether call value can be greater than
the total value of all transactions received by the caller
"""
model = solver.get_model(
node.constraints + not_creator_constraints + [call_value > 0]
)
transaction_sequence = solver.get_transaction_sequence(
state, node.constraints + not_creator_constraints + [call_value > 0]
)
# For now we only report an issue if zero ETH has been sent to the contract account.
for key, value in transaction_sequence.items():
if int(value["call_value"], 16) > 0:
return []
debug = "Transaction Sequence: " + str(transaction_sequence)
issue = Issue(
contract=node.contract_name,
function_name=node.function_name,
address=instruction["address"],
swc_id=UNPROTECTED_ETHER_WITHDRAWAL,
title="Ether thief",
_type="Warning",
bytecode=state.environment.code.bytecode,
description="Users other than the contract creator can withdraw ETH from the contract account"
+ " without previously having sent any ETH to it. This is likely to be vulnerability.",
debug=debug,
)
issues.append(issue)
except UnsatError:
logging.debug("[ETHER_THIEF] no model found")
return issues

@ -64,7 +64,7 @@ def execute(statespace):
if call.type == "CALL":
logging.info(
logging.debug(
"[EXTERNAL_CALLS] Call to: %s, value = %s, gas = %s"
% (str(call.to), str(call.value), str(call.gas))
)

@ -70,10 +70,13 @@ def _check_integer_overflow(statespace, state, node):
op1 = BitVecVal(op1, 256)
# Formulate expression
# FIXME: handle exponentiation
if instruction["opcode"] == "ADD":
operator = "add"
expr = op0 + op1
# constraint = Not(BVAddNoOverflow(op0, op1, signed=False))
else:
operator = "multiply"
expr = op1 * op0
# constraint = Not(BVMulNoOverflow(op0, op1, signed=False))
@ -101,10 +104,16 @@ def _check_integer_overflow(statespace, state, node):
_type="Warning",
)
issue.description = "The arithmetic operation can result in integer overflow.\n"
issue.debug = "Transaction Sequence: " + str(
solver.get_transaction_sequence(state, node.constraints)
issue.description = "This binary {} operation can result in integer overflow.\n".format(
operator
)
try:
issue.debug = "Transaction Sequence: " + str(
solver.get_transaction_sequence(state, node.constraints)
)
except UnsatError:
return issues
issues.append(issue)
return issues

@ -1,4 +1,5 @@
from mythril.analysis import solver
from mythril.analysis.analysis_utils import get_non_creator_constraints
from mythril.analysis.ops import *
from mythril.analysis.report import Issue
from mythril.analysis.swc_data import UNPROTECTED_SELFDESTRUCT
@ -53,16 +54,10 @@ def _analyze_state(state, node):
else:
description += "The remaining Ether is sent to: " + str(to) + "\n"
not_creator_constraints = []
if len(state.world_state.transaction_sequence) > 1:
creator = state.world_state.transaction_sequence[0].caller
for transaction in state.world_state.transaction_sequence[1:]:
not_creator_constraints.append(
Not(Extract(159, 0, transaction.caller) == Extract(159, 0, creator))
)
not_creator_constraints.append(
Not(Extract(159, 0, transaction.caller) == 0)
)
not_creator_constraints, constrained = get_non_creator_constraints(state)
if constrained:
return []
try:
model = solver.get_model(node.constraints + not_creator_constraints)

@ -47,7 +47,7 @@ class Issue:
issue = {
"title": self.title,
"swc_id": self.swc_id,
"swc-id": self.swc_id,
"contract": self.contract,
"description": self.description,
"function": self.function,

@ -1,4 +1,4 @@
from z3 import Solver, simplify, sat, unknown, FuncInterp, UGE
from z3 import Solver, simplify, sat, unknown, FuncInterp, UGE, Optimize
from mythril.exceptions import UnsatError
from mythril.laser.ethereum.transaction.transaction_models import (
ContractCreationTransaction,
@ -6,17 +6,28 @@ from mythril.laser.ethereum.transaction.transaction_models import (
import logging
def get_model(constraints):
s = Solver()
def get_model(constraints, minimize=(), maximize=()):
s = Optimize()
s.set("timeout", 100000)
for constraint in constraints:
if type(constraint) == bool and not constraint:
raise UnsatError
constraints = [constraint for constraint in constraints if type(constraint) != bool]
for constraint in constraints:
s.add(constraint)
for e in minimize:
s.minimize(e)
for e in maximize:
s.maximize(e)
result = s.check()
if result == sat:
return s.model()
elif result == unknown:
logging.info("Timeout encountered while solving expression using z3")
logging.debug("Timeout encountered while solving expression using z3")
raise UnsatError
@ -59,14 +70,17 @@ def get_transaction_sequence(global_state, constraints):
"caller": "0xCA11EDEADBEEF37E636E6CA11EDEADBEEFCA11ED",
}
txs = {}
concrete_transactions = {}
creation_tx_ids = []
tx_constraints = constraints.copy()
minimize = []
transactions = []
for transaction in transaction_sequence:
tx_id = str(transaction.id)
if not isinstance(transaction, ContractCreationTransaction):
transactions.append(transaction)
# Constrain calldatasize
max_calldatasize = 5000
if max_calldatasize != None:
@ -74,39 +88,30 @@ def get_transaction_sequence(global_state, constraints):
UGE(max_calldatasize, transaction.call_data.calldatasize)
)
txs[tx_id] = tx_template.copy()
minimize.append(transaction.call_data.calldatasize)
concrete_transactions[tx_id] = tx_template.copy()
else:
creation_tx_ids.append(tx_id)
model = get_model(tx_constraints)
model = get_model(tx_constraints, minimize=minimize)
for transaction in transaction_sequence:
if not isinstance(transaction, ContractCreationTransaction):
tx_id = str(transaction.id)
txs[tx_id]["calldata"] = "0x" + "".join(
[
hex(b)[2:] if len(hex(b)) % 2 == 0 else "0" + hex(b)[2:]
for b in transaction.call_data.concretized(model)
]
)
for d in model.decls():
name = d.name()
if "call_value" in name:
tx_id = name.replace("call_value", "")
if not tx_id in creation_tx_ids:
call_value = "0x%x" % model[d].as_long()
txs[tx_id]["call_value"] = call_value
if "caller" in name:
# caller is 'creator' for creation transactions
tx_id = name.replace("caller", "")
caller = "0x" + ("%x" % model[d].as_long()).zfill(64)
txs[tx_id]["caller"] = caller
for transaction in transactions:
tx_id = str(transaction.id)
return txs
concrete_transactions[tx_id]["calldata"] = "0x" + "".join(
[
hex(b)[2:] if len(hex(b)) % 2 == 0 else "0" + hex(b)[2:]
for b in transaction.call_data.concretized(model)
]
)
concrete_transactions[tx_id]["call_value"] = (
"0x%x" % model.eval(transaction.call_value, model_completion=True).as_long()
)
concrete_transactions[tx_id]["caller"] = "0x" + (
"%x" % model.eval(transaction.caller, model_completion=True).as_long()
).zfill(40)
return concrete_transactions

@ -1,6 +1,6 @@
from mythril.laser.ethereum import svm
from mythril.laser.ethereum.state import Account
from mythril.ether.soliditycontract import SolidityContract
from mythril.ether.soliditycontract import SolidityContract, ETHContract
import copy
import logging
from .ops import get_variable, SStore, Call, VarType
@ -64,6 +64,10 @@ class SymExecWrapper:
self.laser.sym_exec(
creation_code=contract.creation_code, contract_name=contract.name
)
elif isinstance(contract, ETHContract) and contract.creation_code:
self.laser.sym_exec(
creation_code=contract.creation_code, contract_name=contract.name
)
else:
self.laser.sym_exec(address)

@ -3,7 +3,7 @@
{% for issue in issues %}
## {{ issue.title }}
- SWC ID: {{ issue.swc_id }}
- SWC ID: {{ issue['swc-id'] }}
- Type: {{ issue.type }}
- Contract: {{ issue.contract | default("Unknown") }}
- Function name: `{{ issue.function }}`
@ -34,4 +34,4 @@ In file: {{ issue.filename }}:{{ issue.lineno }}
{% else %}
The analysis was completed successfully. No issues were detected.
{% endif %}
{% endif %}

@ -1,7 +1,7 @@
{% if issues %}
{% for issue in issues %}
==== {{ issue.title }} ====
SWC ID: {{ issue.swc_id }}
SWC ID: {{ issue['swc-id'] }}
Type: {{ issue.type }}
Contract: {{ issue.contract | default("Unknown") }}
Function name: {{ issue.function }}
@ -27,4 +27,4 @@ DEBUGGING INFORMATION:
{% endfor %}
{% else %}
The analysis was completed successfully. No issues were detected.
{% endif %}
{% endif %}

@ -6,7 +6,7 @@ import re
class ETHContract(persistent.Persistent):
def __init__(
self, code, creation_code="", name="Unknown", enable_online_lookup=False
self, code="", creation_code="", name="Unknown", enable_online_lookup=False
):
# Workaround: We currently do not support compile-time linking.
@ -27,7 +27,6 @@ class ETHContract(persistent.Persistent):
def as_dict(self):
return {
"address": self.address,
"name": self.name,
"code": self.code,
"creation_code": self.creation_code,

@ -25,18 +25,27 @@ class SourceCodeInfo:
self.code = code
def get_contracts_from_file(input_file, solc_args=None):
data = get_solc_json(input_file, solc_args=solc_args)
for key, contract in data["contracts"].items():
filename, name = key.split(":")
if filename == input_file and len(contract["bin-runtime"]):
yield SolidityContract(input_file, name, solc_args)
def get_contracts_from_file(input_file, solc_args=None, solc_binary="solc"):
data = get_solc_json(input_file, solc_args=solc_args, solc_binary=solc_binary)
try:
for key, contract in data["contracts"].items():
filename, name = key.split(":")
if filename == input_file and len(contract["bin-runtime"]):
yield SolidityContract(
input_file=input_file,
name=name,
solc_args=solc_args,
solc_binary=solc_binary,
)
except KeyError:
raise NoContractFoundError
class SolidityContract(ETHContract):
def __init__(self, input_file, name=None, solc_args=None):
def __init__(self, input_file, name=None, solc_args=None, solc_binary="solc"):
data = get_solc_json(input_file, solc_args=solc_args)
data = get_solc_json(input_file, solc_args=solc_args, solc_binary=solc_binary)
self.solidity_files = []

@ -21,7 +21,7 @@ import mythril.support.signatures as sigs
def exit_with_error(format_, message):
if format_ == "text" or format_ == "markdown":
print(message)
logging.error(message)
else:
result = {"success": False, "error": str(message), "issues": []}
print(json.dumps(result))
@ -90,6 +90,16 @@ def main():
action="store_true",
help="auto-load dependencies from the blockchain",
)
inputs.add_argument(
"--no-onchain-storage-access",
action="store_true",
help="turns off getting the data from onchain contracts",
)
inputs.add_argument(
"--bin-runtime",
action="store_true",
help="Only when -c or -f is used. Consider the input bytecode as binary runtime code, default being the contract creation bytecode.",
)
outputs = parser.add_argument_group("output formats")
outputs.add_argument(
@ -159,10 +169,9 @@ def main():
options.add_argument(
"--max-transaction-count",
type=int,
default=1,
default=2,
help="Maximum number of transactions issued by laser",
)
options.add_argument(
"--execution-timeout",
type=int,
@ -268,10 +277,15 @@ def main():
mythril = Mythril(
solv=args.solv,
dynld=args.dynld,
onchain_storage_access=(not args.no_onchain_storage_access),
solc_args=args.solc_args,
enable_online_lookup=args.query_signature,
)
if args.dynld and not (args.rpc or args.i):
if (
args.dynld
or not args.no_onchain_storage_access
and not (args.rpc or args.i)
):
mythril.set_api_from_config_path()
if args.address:
@ -280,7 +294,7 @@ def main():
mythril.set_api_rpc_infura()
elif args.rpc:
mythril.set_api_rpc(rpc=args.rpc, rpctls=args.rpctls)
elif not args.dynld:
elif not (args.dynld or not args.no_onchain_storage_access):
mythril.set_api_rpc_localhost()
elif args.search or args.contract_hash_to_address:
# Open LevelDB if necessary
@ -317,10 +331,10 @@ def main():
if args.code:
# Load from bytecode
address, _ = mythril.load_from_bytecode(args.code)
address, _ = mythril.load_from_bytecode(args.code, args.bin_runtime)
elif args.codefile:
bytecode = "".join([l.strip() for l in args.codefile if len(l.strip()) > 0])
address, _ = mythril.load_from_bytecode(bytecode)
address, _ = mythril.load_from_bytecode(bytecode, args.bin_runtime)
elif args.address:
# Get bytecode from a contract address
address, _ = mythril.load_from_address(args.address)

@ -1,5 +1,6 @@
import logging
from z3 import simplify, Extract
from typing import Union
from z3 import simplify, ExprRef, Extract
import mythril.laser.ethereum.util as util
from mythril.laser.ethereum.state import Account, CalldataType, GlobalState, Calldata
from mythril.support.loader import DynLoader
@ -32,13 +33,10 @@ def get_call_parameters(
callee_account = None
call_data, call_data_type = get_call_data(
global_state, memory_input_offset, memory_input_size, False
global_state, memory_input_offset, memory_input_size
)
if int(callee_address, 16) >= 5 or int(callee_address, 16) == 0:
call_data, call_data_type = get_call_data(
global_state, memory_input_offset, memory_input_size
)
callee_account = get_callee_account(
global_state, callee_address, dynamic_loader
)
@ -56,7 +54,7 @@ def get_call_parameters(
def get_callee_address(
global_state: GlobalState, dynamic_loader: DynLoader, symbolic_to_address
global_state: GlobalState, dynamic_loader: DynLoader, symbolic_to_address: ExprRef
):
"""
Gets the address of the callee
@ -98,7 +96,9 @@ def get_callee_address(
return callee_address
def get_callee_account(global_state, callee_address, dynamic_loader):
def get_callee_account(
global_state: GlobalState, callee_address: str, dynamic_loader: DynLoader
):
"""
Gets the callees account from the global_state
:param global_state: state to look in
@ -122,9 +122,9 @@ def get_callee_account(global_state, callee_address, dynamic_loader):
try:
code = dynamic_loader.dynld(environment.active_account.address, callee_address)
except Exception:
logging.debug("Unable to execute dynamic loader.")
raise ValueError()
except ValueError as error:
logging.debug("Unable to execute dynamic loader because: {}".format(str(error)))
raise error
if code is None:
logging.debug("No code returned, not a contract account?")
raise ValueError()
@ -138,7 +138,11 @@ def get_callee_account(global_state, callee_address, dynamic_loader):
return callee_account
def get_call_data(global_state, memory_start, memory_size, pad=True):
def get_call_data(
global_state: GlobalState,
memory_start: Union[int, ExprRef],
memory_size: Union[int, ExprRef],
):
"""
Gets call_data from the global_state
:param global_state: state to look in
@ -172,7 +176,7 @@ def get_call_data(global_state, memory_start, memory_size, pad=True):
call_data_type = CalldataType.CONCRETE
logging.debug("Calldata: " + str(call_data))
except TypeError:
logging.info("Unsupported symbolic calldata offset")
logging.debug("Unsupported symbolic calldata offset")
call_data_type = CalldataType.SYMBOLIC
call_data = Calldata("{}_internalcall".format(transaction_id))

@ -1,5 +1,6 @@
from flags import Flags
from enum import Enum
from typing import Dict
gbl_next_uid = 0 # node counter
@ -18,7 +19,7 @@ class NodeFlags(Flags):
class Node:
def __init__(self, contract_name, start_addr=0, constraints=None):
def __init__(self, contract_name: str, start_addr=0, constraints=None):
constraints = constraints if constraints else []
self.contract_name = contract_name
self.start_addr = start_addr
@ -28,18 +29,14 @@ class Node:
self.flags = NodeFlags()
# Self-assign a unique ID
global gbl_next_uid
self.uid = gbl_next_uid
gbl_next_uid += 1
def get_cfg_dict(self):
def get_cfg_dict(self) -> Dict:
code = ""
for state in self.states:
instruction = state.get_current_instruction()
code += str(instruction["address"]) + " " + instruction["opcode"]
@ -58,16 +55,20 @@ class Node:
class Edge:
def __init__(
self, node_from, node_to, edge_type=JumpType.UNCONDITIONAL, condition=None
self,
node_from: int,
node_to: int,
edge_type=JumpType.UNCONDITIONAL,
condition=None,
):
self.node_from = node_from
self.node_to = node_to
self.type = edge_type
self.condition = condition
def __str__(self):
def __str__(self) -> str:
return str(self.as_dict)
@property
def as_dict(self):
def as_dict(self) -> Dict[str, int]:
return {"from": self.node_from, "to": self.node_to}

@ -1,6 +1,9 @@
import binascii
import logging
from copy import copy, deepcopy
from typing import Callable, List, Union
from functools import reduce
from ethereum import utils
from z3 import (
@ -42,6 +45,8 @@ from mythril.laser.ethereum.transaction import (
TransactionStartSignal,
ContractCreationTransaction,
)
from mythril.support.loader import DynLoader
from mythril.analysis.solver import get_model
TT256 = 2 ** 256
TT256M1 = 2 ** 256 - 1
@ -61,18 +66,20 @@ class StateTransition(object):
self.increment_pc = increment_pc
@staticmethod
def call_on_state_copy(func, func_obj, state):
def call_on_state_copy(func: Callable, func_obj: "Instruction", state: GlobalState):
global_state_copy = copy(state)
return func(func_obj, global_state_copy)
def increment_states_pc(self, states):
def increment_states_pc(self, states: List[GlobalState]) -> List[GlobalState]:
if self.increment_pc:
for state in states:
state.mstate.pc += 1
return states
def __call__(self, func):
def wrapper(func_obj, global_state):
def __call__(self, func: Callable) -> Callable:
def wrapper(
func_obj: "Instruction", global_state: GlobalState
) -> List[GlobalState]:
new_global_states = self.call_on_state_copy(func, func_obj, global_state)
return self.increment_states_pc(new_global_states)
@ -84,11 +91,11 @@ class Instruction:
Instruction class is used to mutate a state according to the current instruction
"""
def __init__(self, op_code, dynamic_loader):
def __init__(self, op_code: str, dynamic_loader: DynLoader):
self.dynamic_loader = dynamic_loader
self.op_code = op_code
def evaluate(self, global_state, post=False):
def evaluate(self, global_state: GlobalState, post=False) -> List[GlobalState]:
""" Performs the mutation for this instruction """
# Generalize some ops
logging.debug("Evaluating {}".format(self.op_code))
@ -114,11 +121,11 @@ class Instruction:
return instruction_mutator(global_state)
@StateTransition()
def jumpdest_(self, global_state):
def jumpdest_(self, global_state: GlobalState) -> List[GlobalState]:
return [global_state]
@StateTransition()
def push_(self, global_state):
def push_(self, global_state: GlobalState) -> List[GlobalState]:
push_instruction = global_state.get_current_instruction()
push_value = push_instruction["argument"][2:]
@ -132,25 +139,25 @@ class Instruction:
return [global_state]
@StateTransition()
def dup_(self, global_state):
def dup_(self, global_state: GlobalState) -> List[GlobalState]:
value = int(global_state.get_current_instruction()["opcode"][3:], 10)
global_state.mstate.stack.append(global_state.mstate.stack[-value])
return [global_state]
@StateTransition()
def swap_(self, global_state):
def swap_(self, global_state: GlobalState) -> List[GlobalState]:
depth = int(self.op_code[4:])
stack = global_state.mstate.stack
stack[-depth - 1], stack[-1] = stack[-1], stack[-depth - 1]
return [global_state]
@StateTransition()
def pop_(self, global_state):
def pop_(self, global_state: GlobalState) -> List[GlobalState]:
global_state.mstate.stack.pop()
return [global_state]
@StateTransition()
def and_(self, global_state):
def and_(self, global_state: GlobalState) -> List[GlobalState]:
stack = global_state.mstate.stack
op1, op2 = stack.pop(), stack.pop()
if type(op1) == BoolRef:
@ -162,7 +169,7 @@ class Instruction:
return [global_state]
@StateTransition()
def or_(self, global_state):
def or_(self, global_state: GlobalState) -> List[GlobalState]:
stack = global_state.mstate.stack
op1, op2 = stack.pop(), stack.pop()
@ -177,7 +184,7 @@ class Instruction:
return [global_state]
@StateTransition()
def xor_(self, global_state):
def xor_(self, global_state: GlobalState) -> List[GlobalState]:
mstate = global_state.mstate
mstate.stack.append(mstate.stack.pop() ^ mstate.stack.pop())
return [global_state]
@ -189,7 +196,7 @@ class Instruction:
return [global_state]
@StateTransition()
def byte_(self, global_state):
def byte_(self, global_state: GlobalState) -> List[GlobalState]:
mstate = global_state.mstate
op0, op1 = mstate.stack.pop(), mstate.stack.pop()
if not isinstance(op1, ExprRef):
@ -214,7 +221,7 @@ class Instruction:
# Arithmetic
@StateTransition()
def add_(self, global_state):
def add_(self, global_state: GlobalState) -> List[GlobalState]:
global_state.mstate.stack.append(
(
helper.pop_bitvec(global_state.mstate)
@ -224,7 +231,7 @@ class Instruction:
return [global_state]
@StateTransition()
def sub_(self, global_state):
def sub_(self, global_state: GlobalState) -> List[GlobalState]:
global_state.mstate.stack.append(
(
helper.pop_bitvec(global_state.mstate)
@ -234,7 +241,7 @@ class Instruction:
return [global_state]
@StateTransition()
def mul_(self, global_state):
def mul_(self, global_state: GlobalState) -> List[GlobalState]:
global_state.mstate.stack.append(
(
helper.pop_bitvec(global_state.mstate)
@ -244,7 +251,7 @@ class Instruction:
return [global_state]
@StateTransition()
def div_(self, global_state):
def div_(self, global_state: GlobalState) -> List[GlobalState]:
op0, op1 = (
util.pop_bitvec(global_state.mstate),
util.pop_bitvec(global_state.mstate),
@ -256,7 +263,7 @@ class Instruction:
return [global_state]
@StateTransition()
def sdiv_(self, global_state):
def sdiv_(self, global_state: GlobalState) -> List[GlobalState]:
s0, s1 = (
util.pop_bitvec(global_state.mstate),
util.pop_bitvec(global_state.mstate),
@ -268,7 +275,7 @@ class Instruction:
return [global_state]
@StateTransition()
def mod_(self, global_state):
def mod_(self, global_state: GlobalState) -> List[GlobalState]:
s0, s1 = (
util.pop_bitvec(global_state.mstate),
util.pop_bitvec(global_state.mstate),
@ -277,7 +284,7 @@ class Instruction:
return [global_state]
@StateTransition()
def smod_(self, global_state):
def smod_(self, global_state: GlobalState) -> List[GlobalState]:
s0, s1 = (
util.pop_bitvec(global_state.mstate),
util.pop_bitvec(global_state.mstate),
@ -286,7 +293,7 @@ class Instruction:
return [global_state]
@StateTransition()
def addmod_(self, global_state):
def addmod_(self, global_state: GlobalState) -> List[GlobalState]:
s0, s1, s2 = (
util.pop_bitvec(global_state.mstate),
util.pop_bitvec(global_state.mstate),
@ -296,7 +303,7 @@ class Instruction:
return [global_state]
@StateTransition()
def mulmod_(self, global_state):
def mulmod_(self, global_state: GlobalState) -> List[GlobalState]:
s0, s1, s2 = (
util.pop_bitvec(global_state.mstate),
util.pop_bitvec(global_state.mstate),
@ -306,7 +313,7 @@ class Instruction:
return [global_state]
@StateTransition()
def exp_(self, global_state):
def exp_(self, global_state: GlobalState) -> List[GlobalState]:
state = global_state.mstate
base, exponent = util.pop_bitvec(state), util.pop_bitvec(state)
@ -323,7 +330,7 @@ class Instruction:
return [global_state]
@StateTransition()
def signextend_(self, global_state):
def signextend_(self, global_state: GlobalState) -> List[GlobalState]:
state = global_state.mstate
s0, s1 = state.stack.pop(), state.stack.pop()
@ -346,28 +353,28 @@ class Instruction:
# Comparisons
@StateTransition()
def lt_(self, global_state):
def lt_(self, global_state: GlobalState) -> List[GlobalState]:
state = global_state.mstate
exp = ULT(util.pop_bitvec(state), util.pop_bitvec(state))
state.stack.append(exp)
return [global_state]
@StateTransition()
def gt_(self, global_state):
def gt_(self, global_state: GlobalState) -> List[GlobalState]:
state = global_state.mstate
exp = UGT(util.pop_bitvec(state), util.pop_bitvec(state))
state.stack.append(exp)
return [global_state]
@StateTransition()
def slt_(self, global_state):
def slt_(self, global_state: GlobalState) -> List[GlobalState]:
state = global_state.mstate
exp = util.pop_bitvec(state) < util.pop_bitvec(state)
state.stack.append(exp)
return [global_state]
@StateTransition()
def sgt_(self, global_state):
def sgt_(self, global_state: GlobalState) -> List[GlobalState]:
state = global_state.mstate
exp = util.pop_bitvec(state) > util.pop_bitvec(state)
@ -375,7 +382,7 @@ class Instruction:
return [global_state]
@StateTransition()
def eq_(self, global_state):
def eq_(self, global_state: GlobalState) -> List[GlobalState]:
state = global_state.mstate
op1 = state.stack.pop()
@ -393,7 +400,7 @@ class Instruction:
return [global_state]
@StateTransition()
def iszero_(self, global_state):
def iszero_(self, global_state: GlobalState) -> List[GlobalState]:
state = global_state.mstate
val = state.stack.pop()
@ -404,7 +411,7 @@ class Instruction:
# Call data
@StateTransition()
def callvalue_(self, global_state):
def callvalue_(self, global_state: GlobalState) -> List[GlobalState]:
state = global_state.mstate
environment = global_state.environment
state.stack.append(environment.callvalue)
@ -412,23 +419,27 @@ class Instruction:
return [global_state]
@StateTransition()
def calldataload_(self, global_state):
def calldataload_(self, global_state: GlobalState) -> List[GlobalState]:
state = global_state.mstate
environment = global_state.environment
op0 = state.stack.pop()
state.stack.append(environment.calldata.get_word_at(op0))
value, constraints = environment.calldata.get_word_at(op0)
state.stack.append(value)
state.constraints.extend(constraints)
return [global_state]
@StateTransition()
def calldatasize_(self, global_state):
def calldatasize_(self, global_state: GlobalState) -> List[GlobalState]:
state = global_state.mstate
environment = global_state.environment
state.stack.append(environment.calldata.calldatasize)
return [global_state]
@StateTransition()
def calldatacopy_(self, global_state):
def calldatacopy_(self, global_state: GlobalState) -> List[GlobalState]:
state = global_state.mstate
environment = global_state.environment
op0, op1, op2 = state.stack.pop(), state.stack.pop(), state.stack.pop()
@ -494,16 +505,18 @@ class Instruction:
try:
i_data = dstart
new_memory = []
for i in range(size):
new_memory.append(environment.calldata[i_data])
value, constraints = environment.calldata[i_data]
new_memory.append(value)
state.constraints.extend(constraints)
i_data = (
i_data + 1 if isinstance(i_data, int) else simplify(i_data + 1)
)
for i in range(len(new_memory)):
state.memory[i + mstart] = new_memory[i]
for i in range(0, len(new_memory), 32):
state.memory[i + mstart] = simplify(Concat(new_memory[i : i + 32]))
except IndexError:
logging.debug("Exception copying calldata to memory")
@ -521,35 +534,35 @@ class Instruction:
# Environment
@StateTransition()
def address_(self, global_state):
def address_(self, global_state: GlobalState) -> List[GlobalState]:
state = global_state.mstate
environment = global_state.environment
state.stack.append(environment.address)
return [global_state]
@StateTransition()
def balance_(self, global_state):
def balance_(self, global_state: GlobalState) -> List[GlobalState]:
state = global_state.mstate
address = state.stack.pop()
state.stack.append(global_state.new_bitvec("balance_at_" + str(address), 256))
return [global_state]
@StateTransition()
def origin_(self, global_state):
def origin_(self, global_state: GlobalState) -> List[GlobalState]:
state = global_state.mstate
environment = global_state.environment
state.stack.append(environment.origin)
return [global_state]
@StateTransition()
def caller_(self, global_state):
def caller_(self, global_state: GlobalState) -> List[GlobalState]:
state = global_state.mstate
environment = global_state.environment
state.stack.append(environment.sender)
return [global_state]
@StateTransition()
def codesize_(self, global_state):
def codesize_(self, global_state: GlobalState) -> List[GlobalState]:
state = global_state.mstate
environment = global_state.environment
disassembly = environment.code
@ -557,7 +570,7 @@ class Instruction:
return [global_state]
@StateTransition()
def sha3_(self, global_state):
def sha3_(self, global_state: GlobalState) -> List[GlobalState]:
global keccak_function_manager
state = global_state.mstate
@ -596,12 +609,12 @@ class Instruction:
return [global_state]
@StateTransition()
def gasprice_(self, global_state):
def gasprice_(self, global_state: GlobalState) -> List[GlobalState]:
global_state.mstate.stack.append(global_state.new_bitvec("gasprice", 256))
return [global_state]
@StateTransition()
def codecopy_(self, global_state):
def codecopy_(self, global_state: GlobalState) -> List[GlobalState]:
memory_offset, code_offset, size = (
global_state.mstate.stack.pop(),
global_state.mstate.stack.pop(),
@ -686,21 +699,21 @@ class Instruction:
return [global_state]
@StateTransition()
def extcodesize_(self, global_state):
def extcodesize_(self, global_state: GlobalState) -> List[GlobalState]:
state = global_state.mstate
addr = state.stack.pop()
environment = global_state.environment
try:
addr = hex(helper.get_concrete_int(addr))
except TypeError:
logging.info("unsupported symbolic address for EXTCODESIZE")
logging.debug("unsupported symbolic address for EXTCODESIZE")
state.stack.append(global_state.new_bitvec("extcodesize_" + str(addr), 256))
return [global_state]
try:
code = self.dynamic_loader.dynld(environment.active_account.address, addr)
except Exception as e:
logging.info("error accessing contract storage due to: " + str(e))
except (ValueError, AttributeError) as e:
logging.debug("error accessing contract storage due to: " + str(e))
state.stack.append(global_state.new_bitvec("extcodesize_" + str(addr), 256))
return [global_state]
@ -712,7 +725,7 @@ class Instruction:
return [global_state]
@StateTransition()
def extcodecopy_(self, global_state):
def extcodecopy_(self, global_state: GlobalState) -> List[GlobalState]:
# FIXME: not implemented
state = global_state.mstate
addr = state.stack.pop()
@ -720,12 +733,12 @@ class Instruction:
return [global_state]
@StateTransition()
def returndatasize_(self, global_state):
def returndatasize_(self, global_state: GlobalState) -> List[GlobalState]:
global_state.mstate.stack.append(global_state.new_bitvec("returndatasize", 256))
return [global_state]
@StateTransition()
def blockhash_(self, global_state):
def blockhash_(self, global_state: GlobalState) -> List[GlobalState]:
state = global_state.mstate
blocknumber = state.stack.pop()
state.stack.append(
@ -734,35 +747,35 @@ class Instruction:
return [global_state]
@StateTransition()
def coinbase_(self, global_state):
def coinbase_(self, global_state: GlobalState) -> List[GlobalState]:
global_state.mstate.stack.append(global_state.new_bitvec("coinbase", 256))
return [global_state]
@StateTransition()
def timestamp_(self, global_state):
def timestamp_(self, global_state: GlobalState) -> List[GlobalState]:
global_state.mstate.stack.append(global_state.new_bitvec("timestamp", 256))
return [global_state]
@StateTransition()
def number_(self, global_state):
def number_(self, global_state: GlobalState) -> List[GlobalState]:
global_state.mstate.stack.append(global_state.new_bitvec("block_number", 256))
return [global_state]
@StateTransition()
def difficulty_(self, global_state):
def difficulty_(self, global_state: GlobalState) -> List[GlobalState]:
global_state.mstate.stack.append(
global_state.new_bitvec("block_difficulty", 256)
)
return [global_state]
@StateTransition()
def gaslimit_(self, global_state):
def gaslimit_(self, global_state: GlobalState) -> List[GlobalState]:
global_state.mstate.stack.append(global_state.new_bitvec("block_gaslimit", 256))
return [global_state]
# Memory operations
@StateTransition()
def mload_(self, global_state):
def mload_(self, global_state: GlobalState) -> List[GlobalState]:
state = global_state.mstate
op0 = state.stack.pop()
@ -775,12 +788,11 @@ class Instruction:
data = global_state.new_bitvec("mem[" + str(simplify(op0)) + "]", 256)
state.stack.append(data)
return [global_state]
try:
state.mem_extend(offset, 32)
data = util.concrete_int_from_bytes(state.memory, offset)
except IndexError: # Memory slot not allocated
data = global_state.new_bitvec("mem[" + str(offset) + "]", 256)
except TypeError: # Symbolic memory
# TODO: Handle this properly
data = state.memory[offset]
logging.debug("Load from memory[" + str(offset) + "]: " + str(data))
@ -789,7 +801,7 @@ class Instruction:
return [global_state]
@StateTransition()
def mstore_(self, global_state):
def mstore_(self, global_state: GlobalState) -> List[GlobalState]:
state = global_state.mstate
op0, value = state.stack.pop(), state.stack.pop()
@ -811,7 +823,8 @@ class Instruction:
try:
# Attempt to concretize value
_bytes = util.concrete_int_to_bytes(value)
state.memory[mstart : mstart + len(_bytes)] = _bytes
assert len(_bytes) == 32
state.memory[mstart : mstart + 32] = _bytes
except:
try:
state.memory[mstart] = value
@ -821,7 +834,7 @@ class Instruction:
return [global_state]
@StateTransition()
def mstore8_(self, global_state):
def mstore8_(self, global_state: GlobalState) -> List[GlobalState]:
state = global_state.mstate
op0, value = state.stack.pop(), state.stack.pop()
@ -837,7 +850,7 @@ class Instruction:
return [global_state]
@StateTransition()
def sload_(self, global_state):
def sload_(self, global_state: GlobalState) -> List[GlobalState]:
global keccak_function_manager
state = global_state.mstate
@ -881,7 +894,9 @@ class Instruction:
return self._sload_helper(global_state, str(index))
@staticmethod
def _sload_helper(global_state, index, constraints=None):
def _sload_helper(
global_state: GlobalState, index: Union[int, ExprRef], constraints=None
):
try:
data = global_state.environment.active_account.storage[index]
except KeyError:
@ -904,11 +919,10 @@ class Instruction:
yield keccak_argument != argument
@StateTransition()
def sstore_(self, global_state):
def sstore_(self, global_state: GlobalState) -> List[GlobalState]:
global keccak_function_manager
state = global_state.mstate
index, value = state.stack.pop(), state.stack.pop()
logging.debug("Write to storage[" + str(index) + "]")
try:
@ -976,7 +990,7 @@ class Instruction:
return [global_state]
@StateTransition(increment_pc=False)
def jump_(self, global_state):
def jump_(self, global_state: GlobalState) -> List[GlobalState]:
state = global_state.mstate
disassembly = global_state.environment.code
try:
@ -1004,7 +1018,7 @@ class Instruction:
return [new_state]
@StateTransition(increment_pc=False)
def jumpi_(self, global_state):
def jumpi_(self, global_state: GlobalState) -> List[GlobalState]:
state = global_state.mstate
disassembly = global_state.environment.code
states = []
@ -1056,25 +1070,26 @@ class Instruction:
states.append(new_state)
else:
logging.debug("Pruned unreachable states.")
del global_state
return states
@StateTransition()
def pc_(self, global_state):
def pc_(self, global_state: GlobalState) -> List[GlobalState]:
global_state.mstate.stack.append(global_state.mstate.pc - 1)
return [global_state]
@StateTransition()
def msize_(self, global_state):
def msize_(self, global_state: GlobalState) -> List[GlobalState]:
global_state.mstate.stack.append(global_state.new_bitvec("msize", 256))
return [global_state]
@StateTransition()
def gas_(self, global_state):
def gas_(self, global_state: GlobalState) -> List[GlobalState]:
global_state.mstate.stack.append(global_state.new_bitvec("gas", 256))
return [global_state]
@StateTransition()
def log_(self, global_state):
def log_(self, global_state: GlobalState) -> List[GlobalState]:
# TODO: implement me
state = global_state.mstate
dpth = int(self.op_code[3:])
@ -1084,7 +1099,7 @@ class Instruction:
return [global_state]
@StateTransition()
def create_(self, global_state):
def create_(self, global_state: GlobalState) -> List[GlobalState]:
# TODO: implement me
state = global_state.mstate
state.stack.pop(), state.stack.pop(), state.stack.pop()
@ -1093,7 +1108,7 @@ class Instruction:
return [global_state]
@StateTransition()
def return_(self, global_state):
def return_(self, global_state: GlobalState):
state = global_state.mstate
offset, length = state.stack.pop(), state.stack.pop()
return_data = [global_state.new_bitvec("return_data", 256)]
@ -1106,7 +1121,7 @@ class Instruction:
global_state.current_transaction.end(global_state, return_data)
@StateTransition()
def suicide_(self, global_state):
def suicide_(self, global_state: GlobalState):
target = global_state.mstate.stack.pop()
# Often the target of the suicide instruction will be symbolic
@ -1130,7 +1145,7 @@ class Instruction:
global_state.current_transaction.end(global_state)
@StateTransition()
def revert_(self, global_state):
def revert_(self, global_state: GlobalState) -> None:
state = global_state.mstate
offset, length = state.stack.pop(), state.stack.pop()
return_data = [global_state.new_bitvec("return_data", 256)]
@ -1145,20 +1160,20 @@ class Instruction:
)
@StateTransition()
def assert_fail_(self, global_state):
def assert_fail_(self, global_state: GlobalState):
# 0xfe: designated invalid opcode
raise InvalidInstruction
@StateTransition()
def invalid_(self, global_state):
def invalid_(self, global_state: GlobalState):
raise InvalidInstruction
@StateTransition()
def stop_(self, global_state):
def stop_(self, global_state: GlobalState):
global_state.current_transaction.end(global_state)
@StateTransition()
def call_(self, global_state):
def call_(self, global_state: GlobalState) -> List[GlobalState]:
instr = global_state.get_current_instruction()
environment = global_state.environment
@ -1183,7 +1198,7 @@ class Instruction:
)
if 0 < int(callee_address, 16) < 5:
logging.info("Native contract called: " + callee_address)
logging.debug("Native contract called: " + callee_address)
if call_data == [] and call_data_type == CalldataType.SYMBOLIC:
logging.debug("CALL with symbolic data not supported")
return [global_state]
@ -1235,7 +1250,7 @@ class Instruction:
raise TransactionStartSignal(transaction, self.op_code)
@StateTransition()
def call_post(self, global_state):
def call_post(self, global_state: GlobalState) -> List[GlobalState]:
instr = global_state.get_current_instruction()
try:
@ -1243,7 +1258,7 @@ class Instruction:
global_state, self.dynamic_loader, True
)
except ValueError as e:
logging.info(
logging.debug(
"Could not determine required parameters for call, putting fresh symbol on the stack. \n{}".format(
e
)
@ -1297,7 +1312,7 @@ class Instruction:
return [global_state]
@StateTransition()
def callcode_(self, global_state):
def callcode_(self, global_state: GlobalState) -> List[GlobalState]:
instr = global_state.get_current_instruction()
environment = global_state.environment
@ -1306,7 +1321,7 @@ class Instruction:
global_state, self.dynamic_loader, True
)
except ValueError as e:
logging.info(
logging.debug(
"Could not determine required parameters for call, putting fresh symbol on the stack. \n{}".format(
e
)
@ -1330,7 +1345,7 @@ class Instruction:
raise TransactionStartSignal(transaction, self.op_code)
@StateTransition()
def callcode_post(self, global_state):
def callcode_post(self, global_state: GlobalState) -> List[GlobalState]:
instr = global_state.get_current_instruction()
try:
@ -1338,7 +1353,7 @@ class Instruction:
global_state, self.dynamic_loader, True
)
except ValueError as e:
logging.info(
logging.debug(
"Could not determine required parameters for call, putting fresh symbol on the stack. \n{}".format(
e
)
@ -1392,7 +1407,7 @@ class Instruction:
return [global_state]
@StateTransition()
def delegatecall_(self, global_state):
def delegatecall_(self, global_state: GlobalState) -> List[GlobalState]:
instr = global_state.get_current_instruction()
environment = global_state.environment
@ -1401,7 +1416,7 @@ class Instruction:
global_state, self.dynamic_loader
)
except ValueError as e:
logging.info(
logging.debug(
"Could not determine required parameters for call, putting fresh symbol on the stack. \n{}".format(
e
)
@ -1425,7 +1440,7 @@ class Instruction:
raise TransactionStartSignal(transaction, self.op_code)
@StateTransition()
def delegatecall_post(self, global_state):
def delegatecall_post(self, global_state: GlobalState) -> List[GlobalState]:
instr = global_state.get_current_instruction()
try:
@ -1433,7 +1448,7 @@ class Instruction:
global_state, self.dynamic_loader
)
except ValueError as e:
logging.info(
logging.debug(
"Could not determine required parameters for call, putting fresh symbol on the stack. \n{}".format(
e
)
@ -1487,7 +1502,7 @@ class Instruction:
return [global_state]
@StateTransition()
def staticcall_(self, global_state):
def staticcall_(self, global_state: GlobalState) -> List[GlobalState]:
# TODO: implement me
instr = global_state.get_current_instruction()
global_state.mstate.stack.append(

@ -5,14 +5,14 @@ class KeccakFunctionManager:
def __init__(self):
self.keccak_expression_mapping = {}
def is_keccak(self, expression) -> bool:
def is_keccak(self, expression: ExprRef) -> bool:
return str(expression) in self.keccak_expression_mapping.keys()
def get_argument(self, expression) -> ExprRef:
def get_argument(self, expression: str) -> ExprRef:
if not self.is_keccak(expression):
raise ValueError("Expression is not a recognized keccac result")
return self.keccak_expression_mapping[str(expression)][1]
def add_keccak(self, expression: ExprRef, argument: ExprRef):
def add_keccak(self, expression: ExprRef, argument: ExprRef) -> None:
index = str(expression)
self.keccak_expression_mapping[index] = (expression, argument)

@ -1,21 +1,25 @@
# -*- coding: utf8 -*-
import copy
import hashlib
import logging
from typing import Union, List
from ethereum.utils import ecrecover_to_pub
from py_ecc.secp256k1 import N as secp256k1n
from rlp.utils import ALL_BYTES
from mythril.laser.ethereum.util import bytearray_to_int, sha3
from mythril.laser.ethereum.state import Calldata
from mythril.laser.ethereum.util import bytearray_to_int, sha3, get_concrete_int
from z3 import Concat, simplify
class NativeContractException(Exception):
pass
def int_to_32bytes(i): # used because int can't fit as bytes function's input
def int_to_32bytes(
i: int
) -> bytes: # used because int can't fit as bytes function's input
o = [0] * 32
for x in range(32):
o[31 - x] = i & 0xFF
@ -23,7 +27,7 @@ def int_to_32bytes(i): # used because int can't fit as bytes function's input
return bytes(o)
def extract32(data, i):
def extract32(data: bytearray, i: int) -> int:
if i >= len(data):
return 0
o = data[i : min(i + 32, len(data))]
@ -31,8 +35,8 @@ def extract32(data, i):
return bytearray_to_int(o)
def ecrecover(data):
def ecrecover(data: Union[bytes, str, List[int]]) -> bytes:
# TODO: Add type hints
try:
data = bytearray(data)
v = extract32(data, 32)
@ -47,13 +51,13 @@ def ecrecover(data):
try:
pub = ecrecover_to_pub(message, v, r, s)
except Exception as e:
logging.info("An error has occured while extracting public key: " + e)
logging.debug("An error has occured while extracting public key: " + e)
return []
o = [0] * 12 + [x for x in sha3(pub)[-20:]]
return o
def sha256(data):
def sha256(data: Union[bytes, str, List[int]]) -> bytes:
try:
data = bytes(data)
except TypeError:
@ -61,22 +65,39 @@ def sha256(data):
return hashlib.sha256(data).digest()
def ripemd160(data):
def ripemd160(data: Union[bytes, str, List[int]]) -> bytes:
try:
data = bytes(data)
except TypeError:
raise NativeContractException
return 12 * [0] + [i for i in hashlib.new("ripemd160", data).digest()]
digest = hashlib.new("ripemd160", data).digest()
padded = 12 * [0] + list(digest)
return bytes(padded)
def identity(data):
return copy.copy(data)
def identity(data: Union[bytes, str, List[int]]) -> bytes:
# Group up into an array of 32 byte words instead
# of an array of bytes. If saved to memory, 32 byte
# words are currently needed, but a correct memory
# implementation would be byte indexed for the most
# part.
return data
result = []
for i in range(0, len(data), 32):
result.append(simplify(Concat(data[i : i + 32])))
return result
def native_contracts(address, data):
def native_contracts(address: int, data: Calldata):
"""
takes integer address 1, 2, 3, 4
"""
functions = (ecrecover, sha256, ripemd160, identity)
return functions[address - 1](data.starting_calldata)
try:
data = [get_concrete_int(e) for e in data._calldata]
except TypeError:
# Symbolic calldata
data = data._calldata
return functions[address - 1](data)

@ -1,25 +1,26 @@
import struct
from z3 import (
BitVec,
BitVecVal,
BitVecRef,
BitVecNumRef,
BitVecSort,
Solver,
ExprRef,
Concat,
sat,
simplify,
Array,
ForAll,
Solver,
UGT,
Implies,
UGE,
UGT,
)
from z3.z3types import Z3Exception
from mythril.disassembler.disassembly import Disassembly
from mythril.laser.ethereum.cfg import Node
from copy import copy, deepcopy
from enum import Enum
from random import randint
from typing import KeysView, Dict, List, Union, Any, Sequence
from mythril.laser.ethereum.util import get_concrete_int
from mythril.laser.ethereum.evm_exceptions import (
@ -45,7 +46,7 @@ class Calldata:
:param starting_calldata: byte array representing the concrete calldata of a transaction
"""
self.tx_id = tx_id
if starting_calldata:
if starting_calldata is not None:
self._calldata = []
self.calldatasize = BitVecVal(len(starting_calldata), 256)
self.concrete = True
@ -56,62 +57,64 @@ class Calldata:
self.calldatasize = BitVec("{}_calldatasize".format(self.tx_id), 256)
self.concrete = False
self.starting_calldata = starting_calldata or []
@property
def constraints(self):
constraints = []
if self.concrete:
for calldata_byte in self.starting_calldata:
for calldata_byte in starting_calldata:
if type(calldata_byte) == int:
self._calldata.append(BitVecVal(calldata_byte, 8))
else:
self._calldata.append(calldata_byte)
constraints.append(self.calldatasize == len(self.starting_calldata))
else:
x = BitVec("x", 256)
constraints.append(
ForAll(x, Implies(self[x] != 0, UGT(self.calldatasize, x)))
)
return constraints
def concretized(self, model):
result = []
for i in range(
get_concrete_int(model.eval(self.calldatasize, model_completion=True))
):
result.append(get_concrete_int(model.eval(self[i], model_completion=True)))
result.append(
get_concrete_int(model.eval(self._calldata[i], model_completion=True))
)
return result
def get_word_at(self, index: int):
return self[index : index + 32]
def __getitem__(self, item):
def __getitem__(self, item: Union[int, slice]) -> Any:
if isinstance(item, slice):
start, step, stop = item.start, item.step, item.stop
try:
if start is None:
start = 0
if step is None:
step = 1
if stop is None:
stop = self.calldatasize
current_index = (
item.start
if isinstance(item.start, BitVecRef)
else BitVecVal(item.start, 256)
start if isinstance(start, BitVecRef) else BitVecVal(start, 256)
)
dataparts = []
while simplify(current_index != item.stop):
while simplify(current_index != stop):
dataparts.append(self[current_index])
current_index = simplify(current_index + 1)
current_index = simplify(current_index + step)
except Z3Exception:
raise IndexError("Invalid Calldata Slice")
return simplify(Concat(dataparts))
values, constraints = zip(*dataparts)
result_constraints = []
for c in constraints:
result_constraints.extend(c)
return simplify(Concat(values)), result_constraints
if self.concrete:
try:
return self._calldata[get_concrete_int(item)]
return self._calldata[get_concrete_int(item)], ()
except IndexError:
return BitVecVal(0, 8)
return BitVecVal(0, 8), ()
else:
return self._calldata[item]
constraints = [
Implies(self._calldata[item] != 0, UGT(self.calldatasize, item))
]
return self._calldata[item], constraints
class Storage:
@ -129,11 +132,15 @@ class Storage:
self.dynld = dynamic_loader
self.address = address
def __getitem__(self, item):
def __getitem__(self, item: Union[int, slice]) -> Any:
try:
return self._storage[item]
except KeyError:
if self.address and int(self.address[2:], 16) != 0 and self.dynld:
if (
self.address
and int(self.address[2:], 16) != 0
and (self.dynld and self.dynld.storage_loading)
):
try:
self._storage[item] = int(
self.dynld.read_storage(
@ -149,10 +156,10 @@ class Storage:
self._storage[item] = BitVec("storage_" + str(item), 256)
return self._storage[item]
def __setitem__(self, key, value):
def __setitem__(self, key: str, value: ExprRef) -> None:
self._storage[key] = value
def keys(self):
def keys(self) -> KeysView:
return self._storage.keys()
@ -163,7 +170,7 @@ class Account:
def __init__(
self,
address,
address: str,
code=None,
contract_name="unknown",
balance=None,
@ -191,17 +198,17 @@ class Account:
self.deleted = False
def __str__(self):
def __str__(self) -> str:
return str(self.as_dict)
def set_balance(self, balance):
def set_balance(self, balance: ExprRef) -> None:
self.balance = balance
def add_balance(self, balance):
def add_balance(self, balance: ExprRef) -> None:
self.balance += balance
@property
def as_dict(self):
def as_dict(self) -> Dict:
return {
"nonce": self.nonce,
"code": self.code,
@ -217,12 +224,12 @@ class Environment:
def __init__(
self,
active_account,
sender,
calldata,
gasprice,
callvalue,
origin,
active_account: Account,
sender: ExprRef,
calldata: Calldata,
gasprice: ExprRef,
callvalue: ExprRef,
origin: ExprRef,
code=None,
calldata_type=CalldataType.SYMBOLIC,
):
@ -243,11 +250,11 @@ class Environment:
self.origin = origin
self.callvalue = callvalue
def __str__(self):
def __str__(self) -> str:
return str(self.as_dict)
@property
def as_dict(self):
def as_dict(self) -> Dict:
return dict(
active_account=self.active_account,
sender=self.sender,
@ -259,6 +266,43 @@ class Environment:
)
class Constraints(list):
"""
This class should maintain a solver and it's constraints, This class tries to make the Constraints() object
as a simple list of constraints with some background processing.
TODO: add the solver to this class after callback refactor
"""
def __init__(self, constraint_list=None, solver=None, possibility=None):
super(Constraints, self).__init__(constraint_list or [])
self.solver = solver
self.__possibility = possibility
def check_possibility(self):
return True
def append(self, constraint):
super(Constraints, self).append(constraint)
def pop(self, index=-1):
raise NotImplementedError
def __copy__(self):
constraint_list = super(Constraints, self).copy()
return Constraints(constraint_list)
def __deepcopy__(self, memodict=None):
return self.__copy__()
def __add__(self, constraints):
constraints_list = super(Constraints, self).__add__(constraints)
return Constraints(constraint_list=constraints_list)
def __iadd__(self, constraints):
super(Constraints, self).__iadd__(constraints)
return self
class MachineStack(list):
"""
Defines EVM stack, overrides the default list to handle overflows
@ -271,7 +315,7 @@ class MachineStack(list):
default_list = []
super(MachineStack, self).__init__(default_list)
def append(self, element):
def append(self, element: BitVec) -> None:
"""
:param element: element to be appended to the list
:function: appends the element to list if the size is less than STACK_LIMIT, else throws an error
@ -283,7 +327,7 @@ class MachineStack(list):
)
super(MachineStack, self).append(element)
def pop(self, index=-1):
def pop(self, index=-1) -> BitVec:
"""
:param index:index to be popped, same as the list() class.
:returns popped value
@ -295,7 +339,7 @@ class MachineStack(list):
except IndexError:
raise StackUnderflowException("Trying to pop from an empty stack")
def __getitem__(self, item):
def __getitem__(self, item: Union[int, slice]) -> Any:
try:
return super(MachineStack, self).__getitem__(item)
except IndexError:
@ -321,16 +365,18 @@ class MachineState:
MachineState represents current machine state also referenced to as \mu
"""
def __init__(self, gas):
def __init__(
self, gas: int, pc=0, stack=None, memory=None, constraints=None, depth=0
):
""" Constructor for machineState """
self.pc = 0
self.stack = MachineStack()
self.memory = []
self.pc = pc
self.stack = MachineStack(stack)
self.memory = memory or []
self.gas = gas
self.constraints = []
self.depth = 0
self.constraints = constraints or Constraints()
self.depth = depth
def mem_extend(self, start, size):
def mem_extend(self, start: int, size: int) -> None:
"""
Extends the memory of this machine state
:param start: Start of memory extension
@ -341,29 +387,40 @@ class MachineState:
m_extend = start + size - self.memory_size
self.memory.extend(bytearray(m_extend))
def memory_write(self, offset, data):
def memory_write(self, offset: int, data: List[int]) -> None:
""" Writes data to memory starting at offset """
self.mem_extend(offset, len(data))
self.memory[offset : offset + len(data)] = data
def pop(self, amount=1):
def pop(self, amount=1) -> Union[BitVec, List[BitVec]]:
""" Pops amount elements from the stack"""
if amount >= len(self.stack):
if amount > len(self.stack):
raise StackUnderflowException
values = self.stack[-amount:][::-1]
del self.stack[-amount:]
return values[0] if amount == 1 else values
def __deepcopy__(self, memodict=None):
memodict = {} if memodict is None else memodict
return MachineState(
gas=self.gas,
pc=self.pc,
stack=copy(self.stack),
memory=copy(self.memory),
constraints=copy(self.constraints),
depth=self.depth,
)
def __str__(self):
return str(self.as_dict)
@property
def memory_size(self):
def memory_size(self) -> int:
return len(self.memory)
@property
def as_dict(self):
def as_dict(self) -> Dict:
return dict(
pc=self.pc,
stack=self.stack,
@ -380,9 +437,9 @@ class GlobalState:
def __init__(
self,
world_state,
environment,
node,
world_state: "WorldState",
environment: Environment,
node: Node,
machine_state=None,
transaction_stack=None,
last_return_data=None,
@ -396,7 +453,7 @@ class GlobalState:
self.op_code = ""
self.last_return_data = last_return_data
def __copy__(self):
def __copy__(self) -> "GlobalState":
world_state = copy(self.world_state)
environment = copy(self.environment)
mstate = deepcopy(self.mstate)
@ -411,30 +468,32 @@ class GlobalState:
)
@property
def accounts(self):
def accounts(self) -> Dict:
return self.world_state.accounts
# TODO: remove this, as two instructions are confusing
def get_current_instruction(self):
def get_current_instruction(self) -> Dict:
""" Gets the current instruction for this GlobalState"""
instructions = self.environment.code.instruction_list
return instructions[self.mstate.pc]
@property
def current_transaction(self):
def current_transaction(
self
) -> Union["MessageCallTransaction", "ContractCreationTransaction", None]:
# TODO: Remove circular to transaction package to import Transaction classes
try:
return self.transaction_stack[-1][0]
except IndexError:
return None
@property
def instruction(self):
def instruction(self) -> Dict:
return self.get_current_instruction()
def new_bitvec(self, name, size=256):
def new_bitvec(self, name: str, size=256) -> BitVec:
transaction_id = self.current_transaction.id
return BitVec("{}_{}".format(transaction_id, name), size)
@ -451,7 +510,7 @@ class WorldState:
self.node = None
self.transaction_sequence = transaction_sequence or []
def __getitem__(self, item):
def __getitem__(self, item: str) -> Account:
"""
Gets an account from the worldstate using item as key
:param item: Address of the account to get
@ -459,7 +518,7 @@ class WorldState:
"""
return self.accounts[item]
def __copy__(self):
def __copy__(self) -> "WorldState":
new_world_state = WorldState(transaction_sequence=self.transaction_sequence[:])
new_world_state.accounts = copy(self.accounts)
new_world_state.node = self.node
@ -467,7 +526,7 @@ class WorldState:
def create_account(
self, balance=0, address=None, concrete_storage=False, dynamic_loader=None
):
) -> Account:
"""
Create non-contract account
:param address: The account's address
@ -486,7 +545,7 @@ class WorldState:
self._put_account(new_account)
return new_account
def create_initialized_contract_account(self, contract_code, storage):
def create_initialized_contract_account(self, contract_code, storage) -> None:
"""
Creates a new contract account, based on the contract code and storage provided
The contract code only includes the runtime contract bytecode
@ -494,18 +553,19 @@ class WorldState:
:param storage: Initial storage for the contract
:return: The new account
"""
# TODO: Add type hints
new_account = Account(
self._generate_new_address(), code=contract_code, balance=0
)
new_account.storage = storage
self._put_account(new_account)
def _generate_new_address(self):
def _generate_new_address(self) -> str:
""" Generates a new address for the global state"""
while True:
address = "0x" + "".join([str(hex(randint(0, 16)))[-1] for _ in range(20)])
if address not in self.accounts.keys():
return address
def _put_account(self, account):
def _put_account(self, account: Account) -> None:
self.accounts[account.address] = account

@ -1,6 +1,8 @@
"""
This module implements basic symbolic execution search strategies
"""
from ..state import GlobalState
from typing import List
from random import randrange
from . import BasicSearchStrategy
@ -35,7 +37,7 @@ class DepthFirstSearchStrategy(BasicSearchStrategy):
I.E. Follow one path to a leaf, and then continue to the next one
"""
def get_strategic_global_state(self):
def get_strategic_global_state(self) -> GlobalState:
return self.work_list.pop()
@ -45,7 +47,7 @@ class BreadthFirstSearchStrategy(BasicSearchStrategy):
I.E. Execute all states of a "level" before continuing
"""
def get_strategic_global_state(self):
def get_strategic_global_state(self) -> GlobalState:
return self.work_list.pop(0)
@ -54,7 +56,7 @@ class ReturnRandomNaivelyStrategy(BasicSearchStrategy):
chooses a random state from the worklist with equal likelihood
"""
def get_strategic_global_state(self):
def get_strategic_global_state(self) -> GlobalState:
if len(self.work_list) > 0:
return self.work_list.pop(randrange(len(self.work_list)))
else:
@ -66,7 +68,7 @@ class ReturnWeightedRandomStrategy(BasicSearchStrategy):
chooses a random state from the worklist with likelihood based on inverse proportion to depth
"""
def get_strategic_global_state(self):
def get_strategic_global_state(self) -> GlobalState:
probability_distribution = [
1 / (global_state.mstate.depth + 1) for global_state in self.work_list
]

@ -1,6 +1,7 @@
import logging
from typing import List, Tuple, Union, Callable, Dict
from mythril.disassembler.disassembly import Disassembly
from mythril.laser.ethereum.state import WorldState
from mythril.laser.ethereum.state import WorldState, GlobalState
from mythril.laser.ethereum.transaction import (
TransactionStartSignal,
TransactionEndSignal,
@ -9,6 +10,7 @@ from mythril.laser.ethereum.transaction import (
from mythril.laser.ethereum.evm_exceptions import StackUnderflowException
from mythril.laser.ethereum.instructions import Instruction
from mythril.laser.ethereum.cfg import NodeFlags, Node, Edge, JumpType
from mythril.laser.ethereum.state import Account
from mythril.laser.ethereum.strategy.basic import DepthFirstSearchStrategy
from datetime import datetime, timedelta
from copy import copy
@ -36,7 +38,7 @@ class LaserEVM:
def __init__(
self,
accounts,
accounts: Dict[str, Account],
dynamic_loader=None,
max_depth=float("inf"),
execution_timeout=60,
@ -75,16 +77,23 @@ class LaserEVM:
)
@property
def accounts(self):
def accounts(self) -> Dict[str, Account]:
return self.world_state.accounts
def sym_exec(self, main_address=None, creation_code=None, contract_name=None):
def sym_exec(
self,
main_address=None,
creation_code=None,
contract_name=None,
max_transactions=3,
) -> None:
logging.debug("Starting LASER execution")
self.time = datetime.now()
if main_address:
logging.info("Starting message call transaction to {}".format(main_address))
execute_message_call(self, main_address)
self._execute_transactions(main_address)
elif creation_code:
logging.info("Starting contract creation transaction")
created_account = execute_contract_creation(
@ -101,20 +110,7 @@ class LaserEVM:
"Increase the resources for creation execution (--max-depth or --create-timeout)"
)
# Reset code coverage
self.coverage = {}
for i in range(self.max_transaction_count):
initial_coverage = self._get_covered_instructions()
self.time = datetime.now()
logging.info(
"Starting message call transaction, iteration: {}".format(i)
)
execute_message_call(self, created_account.address)
end_coverage = self._get_covered_instructions()
if end_coverage == initial_coverage:
break
self._execute_transactions(created_account.address)
logging.info("Finished symbolic execution")
logging.info(
@ -129,7 +125,25 @@ class LaserEVM:
/ float(coverage[0])
* 100
)
logging.info("Achieved {} coverage for code: {}".format(cov, code))
logging.info("Achieved {:.2f}% coverage for code: {}".format(cov, code))
def _execute_transactions(self, address):
"""
This function executes multiple transactions on the address based on the coverage
:param address: Address of the contract
:return:
"""
self.coverage = {}
for i in range(self.max_transaction_count):
initial_coverage = self._get_covered_instructions()
self.time = datetime.now()
logging.info("Starting message call transaction, iteration: {}".format(i))
execute_message_call(self, address)
end_coverage = self._get_covered_instructions()
if end_coverage == initial_coverage:
break
def _get_covered_instructions(self) -> int:
""" Gets the total number of covered instructions for all accounts in the svm"""
@ -140,7 +154,7 @@ class LaserEVM:
)
return total_covered_instructions
def exec(self, create=False):
def exec(self, create=False) -> None:
for global_state in self.strategy:
if self.execution_timeout and not create:
if (
@ -155,15 +169,16 @@ class LaserEVM:
try:
new_states, op_code = self.execute_state(global_state)
except NotImplementedError:
logging.info("Encountered unimplemented instruction")
logging.debug("Encountered unimplemented instruction")
continue
self.manage_cfg(op_code, new_states)
self.work_list += new_states
self.total_states += len(new_states)
def execute_state(self, global_state):
def execute_state(
self, global_state: GlobalState
) -> Tuple[List[GlobalState], Union[str, None]]:
instructions = global_state.environment.code.instruction_list
try:
op_code = instructions[global_state.mstate.pc]["opcode"]
@ -240,8 +255,12 @@ class LaserEVM:
return new_global_states, op_code
def _end_message_call(
self, return_global_state, global_state, revert_changes=False, return_data=None
):
self,
return_global_state: GlobalState,
global_state: GlobalState,
revert_changes=False,
return_data=None,
) -> List[GlobalState]:
# Resume execution of the transaction initializing instruction
op_code = return_global_state.environment.code.instruction_list[
return_global_state.mstate.pc
@ -266,7 +285,7 @@ class LaserEVM:
return new_global_states
def _measure_coverage(self, global_state):
def _measure_coverage(self, global_state: GlobalState) -> None:
code = global_state.environment.code.bytecode
number_of_instructions = len(global_state.environment.code.instruction_list)
instruction_index = global_state.mstate.pc
@ -279,7 +298,7 @@ class LaserEVM:
self.coverage[code][1][instruction_index] = True
def manage_cfg(self, opcode, new_states):
def manage_cfg(self, opcode: str, new_states: List[GlobalState]) -> None:
if opcode == "JUMP":
assert len(new_states) <= 1
for state in new_states:
@ -314,7 +333,9 @@ class LaserEVM:
for state in new_states:
state.node.states.append(state)
def _new_node_state(self, state, edge_type=JumpType.UNCONDITIONAL, condition=None):
def _new_node_state(
self, state: GlobalState, edge_type=JumpType.UNCONDITIONAL, condition=None
) -> None:
new_node = Node(state.environment.active_account.contract_name)
old_node = state.node
state.node = new_node
@ -356,13 +377,15 @@ class LaserEVM:
new_node.function_name = environment.active_function_name
def _execute_pre_hook(self, op_code, global_state):
def _execute_pre_hook(self, op_code: str, global_state: GlobalState) -> None:
if op_code not in self.pre_hooks.keys():
return
for hook in self.pre_hooks[op_code]:
hook(global_state)
def _execute_post_hook(self, op_code, global_states):
def _execute_post_hook(
self, op_code: str, global_states: List[GlobalState]
) -> None:
if op_code not in self.post_hooks.keys():
return
@ -370,20 +393,20 @@ class LaserEVM:
for global_state in global_states:
hook(global_state)
def hook(self, op_code):
def hook_decorator(function):
def hook(self, op_code: str) -> Callable:
def hook_decorator(func: Callable):
if op_code not in self.pre_hooks.keys():
self.pre_hooks[op_code] = []
self.pre_hooks[op_code].append(function)
return function
self.pre_hooks[op_code].append(func)
return func
return hook_decorator
def post_hook(self, op_code):
def hook_decorator(function):
def post_hook(self, op_code: str) -> Callable:
def hook_decorator(func: Callable):
if op_code not in self.post_hooks.keys():
self.post_hooks[op_code] = []
self.post_hooks[op_code].append(function)
return function
self.post_hooks[op_code].append(func)
return func
return hook_decorator

@ -1,6 +1,11 @@
import logging, copy
import logging
import copy
from typing import Union, List, Tuple
from z3 import ExprRef
import mythril.laser.ethereum.util as helper
from mythril.laser.ethereum.cfg import JumpType
from mythril.laser.ethereum.cfg import JumpType, Node
from mythril.laser.ethereum.state import GlobalState, Environment
from mythril.analysis.symbolic import SymExecWrapper
class TaintRecord:
@ -16,29 +21,29 @@ class TaintRecord:
self.storage = {}
self.states = []
def stack_tainted(self, index):
def stack_tainted(self, index: int) -> Union[bool, None]:
""" Returns taint value of stack element at index"""
if index < len(self.stack):
return self.stack[index]
return None
def memory_tainted(self, index):
def memory_tainted(self, index: int) -> bool:
""" Returns taint value of memory element at index"""
if index in self.memory.keys():
return self.memory[index]
return False
def storage_tainted(self, index):
def storage_tainted(self, index: int) -> bool:
""" Returns taint value of storage element at index"""
if index in self.storage.keys():
return self.storage[index]
return False
def add_state(self, state):
def add_state(self, state: GlobalState) -> None:
""" Adds state with this taint record """
self.states.append(state)
def clone(self):
def clone(self) -> "TaintRecord":
""" Clones this record"""
clone = TaintRecord()
clone.stack = copy.deepcopy(self.stack)
@ -53,7 +58,7 @@ class TaintResult:
def __init__(self):
self.records = []
def check(self, state, stack_index):
def check(self, state: GlobalState, stack_index: int) -> Union[bool, None]:
"""
Checks if stack variable is tainted, before executing the instruction
:param state: state to check variable in
@ -65,11 +70,11 @@ class TaintResult:
return None
return record.stack_tainted(stack_index)
def add_records(self, records):
def add_records(self, records: List[TaintRecord]) -> None:
""" Adds records to this taint result """
self.records += records
def _try_get_record(self, state):
def _try_get_record(self, state: GlobalState) -> Union[TaintRecord, None]:
""" Finds record belonging to the state """
for record in self.records:
if state in record.states:
@ -83,7 +88,9 @@ class TaintRunner:
"""
@staticmethod
def execute(statespace, node, state, initial_stack=None):
def execute(
statespace: SymExecWrapper, node: Node, state: GlobalState, initial_stack=None
) -> TaintResult:
"""
Runs taint analysis on the statespace
:param statespace: symbolic statespace to run taint analysis on
@ -120,7 +127,12 @@ class TaintRunner:
return result
@staticmethod
def children(node, statespace, environment, transaction_stack_length):
def children(
node: Node,
statespace: SymExecWrapper,
environment: Environment,
transaction_stack_length: int,
) -> List[Node]:
direct_children = [
statespace.nodes[edge.node_to]
for edge in statespace.edges
@ -143,7 +155,9 @@ class TaintRunner:
return children
@staticmethod
def execute_node(node, last_record, state_index=0):
def execute_node(
node: Node, last_record: TaintRecord, state_index=0
) -> List[TaintRecord]:
"""
Runs taint analysis on a given node
:param node: node to analyse
@ -158,7 +172,7 @@ class TaintRunner:
return records[1:]
@staticmethod
def execute_state(record, state):
def execute_state(record: TaintRecord, state: GlobalState) -> TaintRecord:
assert len(state.mstate.stack) == len(record.stack)
""" Runs taint analysis on a state """
record.add_state(state)
@ -194,7 +208,7 @@ class TaintRunner:
return new_record
@staticmethod
def mutate_stack(record, mutator):
def mutate_stack(record: TaintRecord, mutator: Tuple[int, int]) -> None:
pop, push = mutator
values = []
@ -207,24 +221,24 @@ class TaintRunner:
record.stack.append(taint)
@staticmethod
def mutate_push(op, record):
def mutate_push(op: str, record: TaintRecord) -> None:
TaintRunner.mutate_stack(record, (0, 1))
@staticmethod
def mutate_dup(op, record):
def mutate_dup(op: str, record: TaintRecord) -> None:
depth = int(op[3:])
index = len(record.stack) - depth
record.stack.append(record.stack[index])
@staticmethod
def mutate_swap(op, record):
def mutate_swap(op: str, record: TaintRecord) -> None:
depth = int(op[4:])
l = len(record.stack) - 1
i = l - depth
record.stack[l], record.stack[i] = record.stack[i], record.stack[l]
@staticmethod
def mutate_mload(record, op0):
def mutate_mload(record: TaintRecord, op0: ExprRef) -> None:
_ = record.stack.pop()
try:
index = helper.get_concrete_int(op0)
@ -236,7 +250,7 @@ class TaintRunner:
record.stack.append(record.memory_tainted(index))
@staticmethod
def mutate_mstore(record, op0):
def mutate_mstore(record: TaintRecord, op0: ExprRef) -> None:
_, value_taint = record.stack.pop(), record.stack.pop()
try:
index = helper.get_concrete_int(op0)
@ -247,7 +261,7 @@ class TaintRunner:
record.memory[index] = value_taint
@staticmethod
def mutate_sload(record, op0):
def mutate_sload(record: TaintRecord, op0: ExprRef) -> None:
_ = record.stack.pop()
try:
index = helper.get_concrete_int(op0)
@ -259,7 +273,7 @@ class TaintRunner:
record.stack.append(record.storage_tainted(index))
@staticmethod
def mutate_sstore(record, op0):
def mutate_sstore(record: TaintRecord, op0: ExprRef) -> None:
_, value_taint = record.stack.pop(), record.stack.pop()
try:
index = helper.get_concrete_int(op0)
@ -270,13 +284,13 @@ class TaintRunner:
record.storage[index] = value_taint
@staticmethod
def mutate_log(record, op):
def mutate_log(record: TaintRecord, op: str) -> None:
depth = int(op[3:])
for _ in range(depth + 2):
record.stack.pop()
@staticmethod
def mutate_call(record, op):
def mutate_call(record: TaintRecord, op: str) -> None:
pops = 6
if op in ("CALL", "CALLCODE"):
pops += 1

@ -26,8 +26,9 @@ def execute_message_call(
gas,
gas_price,
value,
):
) -> None:
""" Executes a message call transaction from all open states """
# TODO: Resolve circular import between .transaction and ..svm to import LaserEVM here
open_states = laser_evm.open_states[:]
del laser_evm.open_states[:]
@ -51,8 +52,9 @@ def execute_message_call(
laser_evm.exec()
def _setup_global_state_for_execution(laser_evm, transaction):
def _setup_global_state_for_execution(laser_evm, transaction) -> None:
""" Sets up global state and cfg for a transactions execution"""
# TODO: Resolve circular import between .transaction and ..svm to import LaserEVM here
global_state = transaction.initial_global_state()
global_state.transaction_stack.append((transaction, None))

@ -3,7 +3,7 @@ from logging import debug
from mythril.disassembler.disassembly import Disassembly
from mythril.laser.ethereum.cfg import Node, Edge, JumpType
from mythril.laser.ethereum.state import CalldataType, Calldata
from mythril.laser.ethereum.state import CalldataType, Account, Calldata
from mythril.laser.ethereum.transaction.transaction_models import (
MessageCallTransaction,
ContractCreationTransaction,
@ -11,8 +11,9 @@ from mythril.laser.ethereum.transaction.transaction_models import (
)
def execute_message_call(laser_evm, callee_address):
def execute_message_call(laser_evm, callee_address: str) -> None:
""" Executes a message call transaction from all open states """
# TODO: Resolve circular import between .transaction and ..svm to import LaserEVM here
open_states = laser_evm.open_states[:]
del laser_evm.open_states[:]
@ -40,8 +41,9 @@ def execute_message_call(laser_evm, callee_address):
def execute_contract_creation(
laser_evm, contract_initialization_code, contract_name=None
):
) -> Account:
""" Executes a contract creation transaction from all open states"""
# TODO: Resolve circular import between .transaction and ..svm to import LaserEVM here
open_states = laser_evm.open_states[:]
del laser_evm.open_states[:]
@ -71,8 +73,9 @@ def execute_contract_creation(
return new_account
def _setup_global_state_for_execution(laser_evm, transaction):
def _setup_global_state_for_execution(laser_evm, transaction) -> None:
""" Sets up global state and cfg for a transactions execution"""
# TODO: Resolve circular import between .transaction and ..svm to import LaserEVM here
global_state = transaction.initial_global_state()
global_state.transaction_stack.append((transaction, None))

@ -1,13 +1,20 @@
import logging
from typing import Union
from mythril.disassembler.disassembly import Disassembly
from mythril.laser.ethereum.state import GlobalState, Environment, WorldState, Calldata
from z3 import BitVec
from mythril.laser.ethereum.state import (
GlobalState,
Environment,
WorldState,
Account,
Calldata,
)
from z3 import BitVec, ExprRef
import array
_next_transaction_id = 0
def get_next_transaction_id():
def get_next_transaction_id() -> int:
global _next_transaction_id
_next_transaction_id += 1
return _next_transaction_id
@ -16,7 +23,7 @@ def get_next_transaction_id():
class TransactionEndSignal(Exception):
""" Exception raised when a transaction is finalized"""
def __init__(self, global_state, revert=False):
def __init__(self, global_state: GlobalState, revert=False):
self.global_state = global_state
self.revert = revert
@ -24,7 +31,11 @@ class TransactionEndSignal(Exception):
class TransactionStartSignal(Exception):
""" Exception raised when a new transaction is started"""
def __init__(self, transaction, op_code):
def __init__(
self,
transaction: Union["MessageCallTransaction", "ContractCreationTransaction"],
op_code: str,
):
self.transaction = transaction
self.op_code = op_code
@ -34,9 +45,9 @@ class MessageCallTransaction:
def __init__(
self,
world_state,
callee_account,
caller,
world_state: WorldState,
callee_account: Account,
caller: ExprRef,
call_data=None,
identifier=None,
gas_price=None,
@ -76,8 +87,8 @@ class MessageCallTransaction:
self.code = code
self.return_data = None
def initial_global_state(self):
# Initialize the execution environment
def initial_global_state(self) -> GlobalState:
"""Initialize the execution environment"""
environment = Environment(
self.callee_account,
self.caller,
@ -91,13 +102,10 @@ class MessageCallTransaction:
global_state = GlobalState(self.world_state, environment, None)
global_state.environment.active_function_name = "fallback"
global_state.mstate.constraints.extend(
global_state.environment.calldata.constraints
)
return global_state
def end(self, global_state, return_data=None, revert=False):
def end(self, global_state: GlobalState, return_data=None, revert=False) -> None:
self.return_data = return_data
raise TransactionEndSignal(global_state, revert)
@ -107,8 +115,8 @@ class ContractCreationTransaction:
def __init__(
self,
world_state,
caller,
world_state: WorldState,
caller: ExprRef,
identifier=None,
callee_account=None,
code=None,
@ -158,8 +166,8 @@ class ContractCreationTransaction:
self.code = code
self.return_data = None
def initial_global_state(self):
# Initialize the execution environment
def initial_global_state(self) -> GlobalState:
"""Initialize the execution environment"""
environment = Environment(
self.callee_account,
self.caller,
@ -173,13 +181,10 @@ class ContractCreationTransaction:
global_state = GlobalState(self.world_state, environment, None)
global_state.environment.active_function_name = "constructor"
global_state.mstate.constraints.extend(
global_state.environment.calldata.constraints
)
return global_state
def end(self, global_state, return_data=None, revert=False):
def end(self, global_state: GlobalState, return_data=None, revert=False):
if (
not all([isinstance(element, int) for element in return_data])

@ -1,6 +1,7 @@
import re
from z3 import *
import logging
from typing import Union, List, Dict
import sha3 as _sha3
@ -10,46 +11,40 @@ TT256M1 = 2 ** 256 - 1
TT255 = 2 ** 255
def sha3(seed):
def sha3(seed: str) -> bytes:
return _sha3.keccak_256(bytes(seed)).digest()
def safe_decode(hex_encoded_string):
def safe_decode(hex_encoded_string: str) -> bytes:
if hex_encoded_string.startswith("0x"):
return bytes.fromhex(hex_encoded_string[2:])
else:
return bytes.fromhex(hex_encoded_string)
def to_signed(i):
def to_signed(i: int) -> int:
return i if i < TT255 else i - TT256
def get_instruction_index(instruction_list, address):
def get_instruction_index(
instruction_list: List[Dict], address: int
) -> Union[int, None]:
index = 0
for instr in instruction_list:
if instr["address"] == address:
return index
index += 1
return None
def get_trace_line(instr, state):
def get_trace_line(instr: Dict, state: "MachineState") -> str:
stack = str(state.stack[::-1])
# stack = re.sub("(\d+)", lambda m: hex(int(m.group(1))), stack)
stack = re.sub("\n", "", stack)
return str(instr["address"]) + " " + instr["opcode"] + "\tSTACK: " + stack
def pop_bitvec(state):
def pop_bitvec(state: "MachineState") -> BitVecVal:
# pop one element from stack, converting boolean expressions and
# concrete Python variables to BitVecVal
@ -68,7 +63,7 @@ def pop_bitvec(state):
return simplify(item)
def get_concrete_int(item):
def get_concrete_int(item: Union[int, ExprRef]) -> int:
if isinstance(item, int):
return item
elif isinstance(item, BitVecNumRef):
@ -88,23 +83,20 @@ def get_concrete_int(item):
raise TypeError("Got a symbolic BitVecRef")
def concrete_int_from_bytes(_bytes, start_index):
# logging.debug("-- concrete_int_from_bytes: " + str(_bytes[start_index:start_index+32]))
b = _bytes[start_index : start_index + 32]
val = int.from_bytes(b, byteorder="big")
def concrete_int_from_bytes(concrete_bytes: bytes, start_index: int) -> int:
concrete_bytes = [
byte.as_long() if type(byte) == BitVecNumRef else byte
for byte in concrete_bytes
]
integer_bytes = concrete_bytes[start_index : start_index + 32]
return val
return int.from_bytes(integer_bytes, byteorder="big")
def concrete_int_to_bytes(val):
# logging.debug("concrete_int_to_bytes " + str(val))
if type(val) == int:
return val.to_bytes(32, byteorder="big")
return (simplify(val).as_long()).to_bytes(32, byteorder="big")

@ -78,12 +78,18 @@ class Mythril(object):
"""
def __init__(
self, solv=None, solc_args=None, dynld=False, enable_online_lookup=False
self,
solv=None,
solc_args=None,
dynld=False,
enable_online_lookup=False,
onchain_storage_access=True,
):
self.solv = solv
self.solc_args = solc_args
self.dynld = dynld
self.onchain_storage_access = onchain_storage_access
self.enable_online_lookup = enable_online_lookup
self.mythril_dir = self._init_mythril_dir()
@ -311,13 +317,24 @@ class Mythril(object):
print(self.eth_db.contract_hash_to_address(hash))
def load_from_bytecode(self, code):
def load_from_bytecode(self, code, bin_runtime=False):
address = util.get_indexed_address(0)
self.contracts.append(
ETHContract(
code, name="MAIN", enable_online_lookup=self.enable_online_lookup
if bin_runtime:
self.contracts.append(
ETHContract(
code=code,
name="MAIN",
enable_online_lookup=self.enable_online_lookup,
)
)
else:
self.contracts.append(
ETHContract(
creation_code=code,
name="MAIN",
enable_online_lookup=self.enable_online_lookup,
)
)
)
return address, self.contracts[-1] # return address and contract object
def load_from_address(self, address):
@ -375,13 +392,18 @@ class Mythril(object):
if contract_name is not None:
contract = SolidityContract(
file, contract_name, solc_args=self.solc_args
input_file=file,
name=contract_name,
solc_args=self.solc_args,
solc_binary=self.solc_binary,
)
self.contracts.append(contract)
contracts.append(contract)
else:
for contract in get_contracts_from_file(
file, solc_args=self.solc_args
input_file=file,
solc_args=self.solc_args,
solc_binary=self.solc_binary,
):
self.contracts.append(contract)
contracts.append(contract)
@ -391,7 +413,7 @@ class Mythril(object):
except CompilerError as e:
raise CriticalError(e)
except NoContractFoundError:
logging.info(
logging.error(
"The file " + file + " does not contain a compilable contract."
)
@ -411,7 +433,11 @@ class Mythril(object):
contract,
address,
strategy,
dynloader=DynLoader(self.eth) if self.dynld else None,
dynloader=DynLoader(
self.eth,
storage_loading=self.onchain_storage_access,
contract_loading=self.dynld,
),
max_depth=max_depth,
execution_timeout=execution_timeout,
create_timeout=create_timeout,
@ -434,7 +460,11 @@ class Mythril(object):
contract,
address,
strategy,
dynloader=DynLoader(self.eth) if self.dynld else None,
dynloader=DynLoader(
self.eth,
storage_loading=self.onchain_storage_access,
contract_loading=self.dynld,
),
max_depth=max_depth,
execution_timeout=execution_timeout,
create_timeout=create_timeout,
@ -460,7 +490,11 @@ class Mythril(object):
contract,
address,
strategy,
dynloader=DynLoader(self.eth) if self.dynld else None,
dynloader=DynLoader(
self.eth,
storage_loading=self.onchain_storage_access,
contract_loading=self.dynld,
),
max_depth=max_depth,
execution_timeout=execution_timeout,
create_timeout=create_timeout,

@ -4,12 +4,19 @@ import re
class DynLoader:
def __init__(self, eth):
def __init__(self, eth, contract_loading=True, storage_loading=True):
self.eth = eth
self.storage_cache = {}
self.contract_loading = contract_loading
self.storage_loading = storage_loading
def read_storage(self, contract_address, index):
if not self.storage_loading:
raise Exception(
"Cannot load from the storage when the storage_loading flag is false"
)
try:
contract_ref = self.storage_cache[contract_address]
data = contract_ref[index]
@ -36,7 +43,10 @@ class DynLoader:
def dynld(self, contract_address, dependency_address):
logging.info(
if not self.contract_loading:
raise ValueError("Cannot load contract when contract_loading flag is false")
logging.debug(
"Dynld at contract " + contract_address + ": " + dependency_address
)
@ -48,7 +58,7 @@ class DynLoader:
else:
return None
logging.info("Dependency address: " + dependency_address)
logging.debug("Dependency address: " + dependency_address)
code = self.eth.eth_getCode(dependency_address)

@ -4,6 +4,7 @@ import re
import sys
import json
import logging
from ethereum.utils import sha3
from mythril.ether.ethcontract import ETHContract
from mythril.ether.soliditycontract import SourceMapping
from mythril.exceptions import CriticalError
@ -41,11 +42,7 @@ def analyze_truffle_project(sigs, args):
sys.exit()
if len(bytecode) < 4:
continue
sigs.import_from_solidity_source(
contractdata["sourcePath"], solc_args=args.solc_args
)
sigs.write()
get_sigs_from_truffle(sigs, contractdata)
ethcontract = ETHContract(bytecode, name=name)
@ -57,6 +54,7 @@ def analyze_truffle_project(sigs, args):
max_depth=args.max_depth,
create_timeout=args.create_timeout,
execution_timeout=args.execution_timeout,
max_transaction_count=args.max_transaction_count,
)
issues = fire_lasers(sym)
@ -74,32 +72,24 @@ def analyze_truffle_project(sigs, args):
report = Report()
# augment with source code
disassembly = ethcontract.disassembly
deployed_disassembly = ethcontract.disassembly
constructor_disassembly = ethcontract.creation_disassembly
source = contractdata["source"]
deployed_source_map = contractdata["deployedSourceMap"].split(";")
source_map = contractdata["sourceMap"].split(";")
mappings = []
for item in deployed_source_map:
mapping = item.split(":")
if len(mapping) > 0 and len(mapping[0]) > 0:
offset = int(mapping[0])
if len(mapping) > 1 and len(mapping[1]) > 0:
length = int(mapping[1])
if len(mapping) > 2 and len(mapping[2]) > 0:
idx = int(mapping[2])
lineno = (
source.encode("utf-8")[0:offset].count("\n".encode("utf-8")) + 1
)
mappings.append(SourceMapping(idx, offset, length, lineno))
deployed_mappings = get_mappings(source, deployed_source_map)
constructor_mappings = get_mappings(source, source_map)
for issue in issues:
if issue.function == "constructor":
mappings = constructor_mappings
disassembly = constructor_disassembly
else:
mappings = deployed_mappings
disassembly = deployed_disassembly
index = get_instruction_index(
disassembly.instruction_list, issue.address
@ -139,3 +129,36 @@ def analyze_truffle_project(sigs, args):
)
elif args.outform == "markdown":
print(report.as_markdown())
def get_sigs_from_truffle(sigs, contract_data):
abis = contract_data["abi"]
for abi in abis:
if abi["type"] != "function":
continue
function_name = abi["name"]
list_of_args = ",".join([input["type"] for input in abi["inputs"]])
signature = function_name + "(" + list_of_args + ")"
sigs.signatures["0x" + sha3(signature)[:4].hex()] = [signature]
sigs.write()
def get_mappings(source, deployed_source_map):
mappings = []
for item in deployed_source_map:
mapping = item.split(":")
if len(mapping) > 0 and len(mapping[0]) > 0:
offset = int(mapping[0])
if len(mapping) > 1 and len(mapping[1]) > 0:
length = int(mapping[1])
if len(mapping) > 2 and len(mapping[2]) > 0:
idx = int(mapping[2])
lineno = source.encode("utf-8")[0:offset].count("\n".encode("utf-8")) + 1
mappings.append(SourceMapping(idx, offset, length, lineno))
return mappings

@ -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.19.3" # NOQA
VERSION = "v0.19.4" # NOQA

@ -24,5 +24,5 @@ pytest_mock
requests
rlp>=1.0.1
transaction>=2.2.1
z3-solver==4.5.1.0.post2
z3-solver==4.8.0.0.post1
pysha3

@ -75,7 +75,7 @@ setup(
install_requires=[
"coloredlogs>=10.0",
"ethereum>=2.3.2",
"z3-solver==4.5.1.0.post2",
"z3-solver==4.8.0.0.post1",
"requests",
"py-solc",
"plyvel",

@ -1 +1 @@
{"0x07f9f7ba": "StandardBounties(address)", "0x8c590917": "contribute(uint256,uint256)", "0x626a413a": "activateBounty(uint256,uint256)", "0x1e688c14": "fulfillBounty(uint256,string)", "0x41ac5dd0": "updateFulfillment(uint256,uint256,string)", "0xd9583497": "acceptFulfillment(uint256,uint256)", "0x16b57509": "killBounty(uint256)", "0x2d1fdef6": "extendDeadline(uint256,uint256)", "0x5d19606e": "transferIssuer(uint256,address)", "0xd6c0ceab": "changeBountyDeadline(uint256,uint256)", "0xf3d3402a": "changeBountyData(uint256,string)", "0x452ccadb": "changeBountyFulfillmentAmount(uint256,uint256)", "0xcdad6576": "changeBountyArbiter(uint256,address)", "0x992a3e75": "changeBountyPaysTokens(uint256,bool,address)", "0x422d4cd6": "increasePayout(uint256,uint256,uint256)", "0xb94b0a3a": "getFulfillment(uint256,uint256)", "0xee8c4bbf": "getBounty(uint256)", "0x86647bac": "getBountyArbiter(uint256)", "0xa60745aa": "getBountyData(uint256)", "0x19dba3d2": "getBountyToken(uint256)", "0x3278ba2f": "getNumBounties()", "0xfbe334f8": "getNumFulfillments(uint256)", "0xdb3b6263": "transitionToState(uint256,BountyStages)", "0x4e3b52fe": "metaCoin()", "0x412664ae": "sendToken(address,uint256)", "0x56885cd8": "crowdfunding()", "0x6c343ffe": "withdrawfunds()", "0xe8b5e51f": "invest()", "0xaa3288f4": "getBalance())", "0xc11a4b47": "Origin()", "0xf2fde38b": "transferOwnership(address)", "0x00362a95": "donate(address)", "0x70a08231": "balanceOf(address)", "0x2e1a7d4d": "withdraw(uint256)", "0x6241bfd1": "Token(uint256)", "0xa3210e87": "sendeth(address,uint256)", "0xcd38aa87": "chooseWinner()", "0xd6d22fa4": "MetaCoin()", "0x90b98a11": "sendCoin(address,uint256)", "0x7bd703e8": "getBalanceInEth(address)", "0xf8b2cb4f": "getBalance(address)", "0xa360b26f": "Migrations()", "0xfdacd576": "setCompleted(uint256)", "0x0900f010": "upgrade(address)", "0xcae9ca51": "approveAndCall(address,uint256,bytes)", "0xa9059cbb": "transfer(address,uint256)", "0x23b872dd": "transferFrom(address,address,uint256)", "0x095ea7b3": "approve(address,uint256)", "0xdd62ed3e": "allowance(address,address)", "0x525f8a5c": "setSaleStartTime(uint256)", "0xd132391a": "setSaleEndTime(uint256)", "0x0a0cd8c8": "setupDone()", "0xd7bb99ba": "contribute()", "0xf0349d5f": "setupStages()", "0x2a4f6533": "createTokenContract())", "0x42a6b21a": "getContributionLimit(address)", "0x1a787915": "startConditions(bytes32)", "0xf3fde261": "onTransition(bytes32)", "0x27816235": "onSaleEnded()", "0x091cde0b": "DisbursementHandler(address)", "0xf3fef3a3": "withdraw(address,uint256)", "0x4bc9fdc2": "calcMaxWithdraw()", "0xc9e61599": "createTarget())", "0x200094e0": "deployContract())", "0x5a048d78": "claim(Target)", "0x16ae6b67": "checkInvariant())", "0x2aa5ed61": "DayLimit(uint256)", "0xe7dde9a3": "_setDailyLimit(uint256)", "0x4a4c82c6": "_resetSpentToday()", "0x180aadb7": "underLimit(uint256)", "0x9d4468ff": "today())", "0x19045a25": "recover(bytes32,bytes)", "0xe92dfb23": "LimitBalance(uint256)", "0xd73dd623": "increaseApproval(address,uint256)", "0x66188463": "decreaseApproval(address,uint256)", "0xabaf5880": "Crowdsale(uint256,uint256,uint256,address)", "0xec8ac4d8": "buyTokens(address)", "0x9d735286": "forwardFunds()", "0x605120cf": "validPurchase())", "0x6e42787f": "hasEnded())", "0xe5c46944": "MultiSigWallet(address[],uint256)", "0x7065cb48": "addOwner(address)", "0x173825d9": "removeOwner(address)", "0xe20056e6": "replaceOwner(address,address)", "0xba51a6df": "changeRequirement(uint256)", "0xc6427474": "submitTransaction(address,uint256,bytes)", "0xc01a8c84": "confirmTransaction(uint256)", "0x20ea8d86": "revokeConfirmation(uint256)", "0xee22610b": "executeTransaction(uint256)", "0x784547a7": "isConfirmed(uint256)", "0xec096f8d": "addTransaction(address,uint256,bytes)", "0x8b51d13f": "getConfirmationCount(uint256)", "0x54741525": "getTransactionCount(bool,bool)", "0xa0e67e2b": "getOwners()", "0xb5dc40c3": "getConfirmations(uint256)", "0xa8abe69a": "getTransactionIds(uint256,uint256,bool,bool)"}
{"0x07f9f7ba": ["StandardBounties(address)"], "0x8c590917": ["contribute(uint256,uint256)"], "0x626a413a": ["activateBounty(uint256,uint256)"], "0x1e688c14": ["fulfillBounty(uint256,string)"], "0x41ac5dd0": ["updateFulfillment(uint256,uint256,string)"], "0xd9583497": ["acceptFulfillment(uint256,uint256)"], "0x16b57509": ["killBounty(uint256)"], "0x2d1fdef6": ["extendDeadline(uint256,uint256)"], "0x5d19606e": ["transferIssuer(uint256,address)"], "0xd6c0ceab": ["changeBountyDeadline(uint256,uint256)"], "0xf3d3402a": ["changeBountyData(uint256,string)"], "0x452ccadb": ["changeBountyFulfillmentAmount(uint256,uint256)"], "0xcdad6576": ["changeBountyArbiter(uint256,address)"], "0x992a3e75": ["changeBountyPaysTokens(uint256,bool,address)"], "0x422d4cd6": ["increasePayout(uint256,uint256,uint256)"], "0xb94b0a3a": ["getFulfillment(uint256,uint256)"], "0xee8c4bbf": ["getBounty(uint256)"], "0x86647bac": ["getBountyArbiter(uint256)"], "0xa60745aa": ["getBountyData(uint256)"], "0x19dba3d2": ["getBountyToken(uint256)"], "0x3278ba2f": ["getNumBounties()"], "0xfbe334f8": ["getNumFulfillments(uint256)"], "0xdb3b6263": ["transitionToState(uint256,BountyStages)"], "0x4e3b52fe": ["metaCoin()"], "0x412664ae": ["sendToken(address,uint256)"], "0x56885cd8": ["crowdfunding()"], "0x6c343ffe": ["withdrawfunds()"], "0xe8b5e51f": ["invest()"], "0xaa3288f4": ["getBalance())"], "0xc11a4b47": ["Origin()"], "0xf2fde38b": ["transferOwnership(address)"], "0x00362a95": ["donate(address)"], "0x70a08231": ["balanceOf(address)"], "0x2e1a7d4d": ["withdraw(uint256)"], "0x6241bfd1": ["Token(uint256)"], "0xa3210e87": ["sendeth(address,uint256)"], "0xcd38aa87": ["chooseWinner()"], "0xd6d22fa4": ["MetaCoin()"], "0x90b98a11": ["sendCoin(address,uint256)"], "0x7bd703e8": ["getBalanceInEth(address)"], "0xf8b2cb4f": ["getBalance(address)"], "0xa360b26f": ["Migrations()"], "0xfdacd576": ["setCompleted(uint256)"], "0x0900f010": ["upgrade(address)"], "0xcae9ca51": ["approveAndCall(address,uint256,bytes)"], "0xa9059cbb": ["transfer(address,uint256)"], "0x23b872dd": ["transferFrom(address,address,uint256)"], "0x095ea7b3": ["approve(address,uint256)"], "0xdd62ed3e": ["allowance(address,address)"], "0x525f8a5c": ["setSaleStartTime(uint256)"], "0xd132391a": ["setSaleEndTime(uint256)"], "0x0a0cd8c8": ["setupDone()"], "0xd7bb99ba": ["contribute()"], "0xf0349d5f": ["setupStages()"], "0x2a4f6533": ["createTokenContract())"], "0x42a6b21a": ["getContributionLimit(address)"], "0x1a787915": ["startConditions(bytes32)"], "0xf3fde261": ["onTransition(bytes32)"], "0x27816235": ["onSaleEnded()"], "0x091cde0b": ["DisbursementHandler(address)"], "0xf3fef3a3": ["withdraw(address,uint256)"], "0x4bc9fdc2": ["calcMaxWithdraw()"], "0xc9e61599": ["createTarget())"], "0x200094e0": ["deployContract())"], "0x5a048d78": ["claim(Target)"], "0x16ae6b67": ["checkInvariant())"], "0x2aa5ed61": ["DayLimit(uint256)"], "0xe7dde9a3": ["_setDailyLimit(uint256)"], "0x4a4c82c6": ["_resetSpentToday()"], "0x180aadb7": ["underLimit(uint256)"], "0x9d4468ff": ["today())"], "0x19045a25": ["recover(bytes32,bytes)"], "0xe92dfb23": ["LimitBalance(uint256)"], "0xd73dd623": ["increaseApproval(address,uint256)"], "0x66188463": ["decreaseApproval(address,uint256)"], "0xabaf5880": ["Crowdsale(uint256,uint256,uint256,address)"], "0xec8ac4d8": ["buyTokens(address)"], "0x9d735286": ["forwardFunds()"], "0x605120cf": ["validPurchase())"], "0x6e42787f": ["hasEnded())"], "0xe5c46944": ["MultiSigWallet(address[],uint256)"], "0x7065cb48": ["addOwner(address)"], "0x173825d9": ["removeOwner(address)"], "0xe20056e6": ["replaceOwner(address,address)"], "0xba51a6df": ["changeRequirement(uint256)"], "0xc6427474": ["submitTransaction(address,uint256,bytes)"], "0xc01a8c84": ["confirmTransaction(uint256)"], "0x20ea8d86": ["revokeConfirmation(uint256)"], "0xee22610b": ["executeTransaction(uint256)"], "0x784547a7": ["isConfirmed(uint256)"], "0xec096f8d": ["addTransaction(address,uint256,bytes)"], "0x8b51d13f": ["getConfirmationCount(uint256)"], "0x54741525": ["getTransactionCount(bool,bool)"], "0xa0e67e2b": ["getOwners()"], "0xb5dc40c3": ["getConfirmations(uint256)"], "0xa8abe69a": ["getTransactionIds(uint256,uint256,bool,bool)"]}

@ -10,7 +10,7 @@ def output_of(command):
class CommandLineToolTestCase(BaseTestCase):
def test_disassemble_code_correctly(self):
command = "python3 {} MYTH -d -c 0x5050".format(MYTH)
command = "python3 {} MYTH -d --bin-runtime -c 0x5050".format(MYTH)
self.assertEqual("0 POP\n1 POP\n", output_of(command))
def test_disassemble_solidity_file_correctly(self):
@ -26,10 +26,10 @@ class CommandLineToolTestCase(BaseTestCase):
class TruffleTestCase(BaseTestCase):
def test_analysis_truffle_project(self):
truffle_project_root = str(TESTS_DIR / "truffle_project")
command = "cd {}; truffle compile; python3 {} --truffle".format(
command = "cd {}; truffle compile; python3 {} --truffle --max-transaction-count 1".format(
truffle_project_root, MYTH
)
self.assertIn("=== Ether send ====", output_of(command))
self.assertIn("=== Ether thief ====", output_of(command))
class InfuraTestCase(BaseTestCase):

@ -0,0 +1,52 @@
{
"address0" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/address0Filler.json",
"sourceHash" : "37a0fc3337fde7233f427195a290be689e01aa752a8394b0ae56306fd97d3624"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x30600055",
"data" : "0x",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x17487699db",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x30600055",
"nonce" : "0x00",
"storage" : {
"0x00" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6"
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x30600055",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,52 @@
{
"address1" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/address1Filler.json",
"sourceHash" : "2f317db88316ea284d36c3031d82818be81d6cf63d1bba9437dd22705282fe27"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"caller" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"code" : "0x30600055",
"data" : "0x",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x17487699db",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x",
"post" : {
"0xcd1722f3947def4cf144679da39c4c32bdc35681" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x30600055",
"nonce" : "0x00",
"storage" : {
"0x00" : "0xcd1722f3947def4cf144679da39c4c32bdc35681"
}
}
},
"pre" : {
"0xcd1722f3947def4cf144679da39c4c32bdc35681" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x30600055",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,52 @@
{
"calldatacopy0" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatacopy0Filler.json",
"sourceHash" : "761871556943693860bdddd26da931c7c3f5a6c8ab95f680aa9d5854135dacd0"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x60026001600037600051600055",
"data" : "0x1234567890abcdef01234567890abcdef0",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x17487699c5",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x60026001600037600051600055",
"nonce" : "0x00",
"storage" : {
"0x00" : "0x3456000000000000000000000000000000000000000000000000000000000000"
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x60026001600037600051600055",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,52 @@
{
"calldatacopy0_return" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatacopy0_returnFiller.json",
"sourceHash" : "4f9c0f3aff470ea35ad2fd5a81a593742f875409dbc51200199dd0f2baab261d"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x60026001600037600051600055596000f3",
"data" : "0x1234567890abcdef01234567890abcdef0",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x17487699c0",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x3456000000000000000000000000000000000000000000000000000000000000",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x60026001600037600051600055596000f3",
"nonce" : "0x00",
"storage" : {
"0x00" : "0x3456000000000000000000000000000000000000000000000000000000000000"
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x60026001600037600051600055596000f3",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,52 @@
{
"calldatacopy1" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatacopy1Filler.json",
"sourceHash" : "65659a844a3d4458eb82347f1ef56c3657abdb06f7166b033329db7c2c8cdb78"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x60016001600037600051600055",
"data" : "0x1234567890abcdef01234567890abcdef0",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x17487699c5",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x60016001600037600051600055",
"nonce" : "0x00",
"storage" : {
"0x00" : "0x3400000000000000000000000000000000000000000000000000000000000000"
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x60016001600037600051600055",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,52 @@
{
"calldatacopy1_return" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatacopy1_returnFiller.json",
"sourceHash" : "671deccb615f7d6e58bc195d11ad4fde489a6a07581f9e32e029e6cf42dba991"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x60016001600037600051600055596000f3",
"data" : "0x1234567890abcdef01234567890abcdef0",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x17487699c0",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x3400000000000000000000000000000000000000000000000000000000000000",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x60016001600037600051600055596000f3",
"nonce" : "0x00",
"storage" : {
"0x00" : "0x3400000000000000000000000000000000000000000000000000000000000000"
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x60016001600037600051600055596000f3",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,51 @@
{
"calldatacopy2" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatacopy2Filler.json",
"sourceHash" : "3acb5771658d79d6ff4e17b69cfeea9bcc5e51ab11afb0c511b4d7be801e71d4"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x60006001600037600051600055",
"data" : "0x1234567890abcdef01234567890abcdef0",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x174876d460",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x60006001600037600051600055",
"nonce" : "0x00",
"storage" : {
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x60006001600037600051600055",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,51 @@
{
"calldatacopy2_return" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatacopy2_returnFiller.json",
"sourceHash" : "4268c07197871b5b5c14bcda3f746a2bb787c8dba2d987bf3c1fb0bc1fc4db4c"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x60006001600037600051600055596000f3",
"data" : "0x1234567890abcdef01234567890abcdef0",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x174876d45b",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x60006001600037600051600055596000f3",
"nonce" : "0x00",
"storage" : {
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x60006001600037600051600055596000f3",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,37 @@
{
"calldatacopyUnderFlow" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatacopyUnderFlowFiller.json",
"sourceHash" : "55ea90b15f19bf8f4838c35234d202eab4473284e5895af23b885368f34200a1"
},
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x6001600237",
"data" : "0x1234567890abcdef01234567890abcdef0",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x6001600237",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,51 @@
{
"calldatacopyZeroMemExpansion" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatacopyZeroMemExpansionFiller.json",
"sourceHash" : "99d8509de4a25c88abd0647c68310552c67f395a92f4e6a8e67cc3707af076c5"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x60006000600037600051600055",
"data" : "0x1234567890abcdef01234567890abcdef0",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x174876d460",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x60006000600037600051600055",
"nonce" : "0x00",
"storage" : {
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x60006000600037600051600055",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,51 @@
{
"calldatacopyZeroMemExpansion_return" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatacopyZeroMemExpansion_returnFiller.json",
"sourceHash" : "b00f6239c55457bfec8870ad2ffaa42b2b53228c4f610eba391b8ce561dc9d4f"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x60006000600037600051600055596000f3",
"data" : "0x1234567890abcdef01234567890abcdef0",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x174876d45b",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x60006000600037600051600055596000f3",
"nonce" : "0x00",
"storage" : {
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x60006000600037600051600055596000f3",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,51 @@
{
"calldatacopy_DataIndexTooHigh" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatacopy_DataIndexTooHighFiller.json",
"sourceHash" : "72c5c7337895354e6d12b41ef4f144db87f945068a1a20134168f7e63f61a0d7"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x60ff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600037600051600055",
"data" : "0x1234567890abcdef01234567890abcdef0",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x174876d433",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x60ff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600037600051600055",
"nonce" : "0x00",
"storage" : {
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x60ff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600037600051600055",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,51 @@
{
"calldatacopy_DataIndexTooHigh2" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatacopy_DataIndexTooHigh2Filler.json",
"sourceHash" : "bf92d18c0d12f1e9d48a5cf116ece7559ad36d67383a8b25792b4b6003180304"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x60097ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600037600051600055",
"data" : "0x1234567890abcdef01234567890abcdef0",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x174876d45d",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x60097ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600037600051600055",
"nonce" : "0x00",
"storage" : {
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x60097ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600037600051600055",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,51 @@
{
"calldatacopy_DataIndexTooHigh2_return" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatacopy_DataIndexTooHigh2_returnFiller.json",
"sourceHash" : "990882750573f3f5938a3f2cd66b0f41c842538f70d70045e179d246b8a076e0"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x60097ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600037600051600055596000f3",
"data" : "0x1234567890abcdef01234567890abcdef0",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x174876d458",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x60097ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600037600051600055596000f3",
"nonce" : "0x00",
"storage" : {
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x60097ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600037600051600055596000f3",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,51 @@
{
"calldatacopy_DataIndexTooHigh_return" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatacopy_DataIndexTooHigh_returnFiller.json",
"sourceHash" : "640a52c64dfe9f43c6c5bb1aa4fc2a95839f352533e95fabe5493ff142b210c7"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x60ff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600037600051600055596000f3",
"data" : "0x1234567890abcdef01234567890abcdef0",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x174876d42e",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x60ff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600037600051600055596000f3",
"nonce" : "0x00",
"storage" : {
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x60ff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600037600051600055596000f3",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,52 @@
{
"calldatacopy_sec" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatacopy_secFiller.json",
"sourceHash" : "9c7568cda862ed10722f83b99c948af03cb38ae4042d45fa55aae12cca979f88"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x6005565b005b6042601f536101036000601f3760005180606014600357640badc0ffee60ff55",
"data" : "0x1234567890abcdef01234567890abcdef0",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x1748769964",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x6005565b005b6042601f536101036000601f3760005180606014600357640badc0ffee60ff55",
"nonce" : "0x00",
"storage" : {
"0xff" : "0x0badc0ffee"
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x0de0b6b3a7640000",
"code" : "0x6005565b005b6042601f536101036000601f3760005180606014600357640badc0ffee60ff55",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,52 @@
{
"calldataload0" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldataload0Filler.json",
"sourceHash" : "3bfae7447ad076b4da51568b72acb70e9bd946fbf68a79705015c4600d9d99de"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x600035600055",
"data" : "0x2560",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x17487699d7",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x600035600055",
"nonce" : "0x00",
"storage" : {
"0x00" : "0x2560000000000000000000000000000000000000000000000000000000000000"
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x600035600055",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,52 @@
{
"calldataload1" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldataload1Filler.json",
"sourceHash" : "3cda66b7abff563a2178c736c6ff9235784bbc4083083c1880268c1f32281606"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x600135600055",
"data" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff23",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x17487699d7",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x600135600055",
"nonce" : "0x00",
"storage" : {
"0x00" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff23"
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x600135600055",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,52 @@
{
"calldataload2" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldataload2Filler.json",
"sourceHash" : "0274681bf0559ab144aa2273cd566d1b32bcc58843ca142e8c6e6fd567196882"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x600535600055",
"data" : "0x123456789abcdef00000000000000000000000000000000000000000000000000024",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x17487699d7",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x600535600055",
"nonce" : "0x00",
"storage" : {
"0x00" : "0xbcdef00000000000000000000000000000000000000000000000000024000000"
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x600535600055",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,51 @@
{
"calldataloadSizeTooHigh" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldataloadSizeTooHighFiller.json",
"sourceHash" : "0a556d7e2b38d3ac82c12938237c81673868011512d36133443339bc000d56c5"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa35600055",
"data" : "0x123456789abcdef00000000000000000000000000000000000000000000000000024",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x174876d46f",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa35600055",
"nonce" : "0x00",
"storage" : {
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa35600055",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,52 @@
{
"calldataloadSizeTooHighPartial" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldataloadSizeTooHighPartialFiller.json",
"sourceHash" : "8090196f324f686f77a7d362987f8697cfc7b6b3bd86d702a212d790ec12ef0f"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x600a35600055",
"data" : "0x123456789abcdef00000000000000000000000000000000000000000000024",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x17487699d7",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x600a35600055",
"nonce" : "0x00",
"storage" : {
"0x00" : "0x240000000000000000000000"
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x600a35600055",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,51 @@
{
"calldataload_BigOffset" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldataload_BigOffsetFiller.json",
"sourceHash" : "e118bc308ccdd052ea601f5cfa51d32fc907952cb1cd16e673bff87f8c9fe203"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x7f420000000000000000000000000000000000000000000000000000000000000035600055",
"data" : "0x4200000000000000000000000000000000000000000000000000000000000000",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x174876d46f",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x7f420000000000000000000000000000000000000000000000000000000000000035600055",
"nonce" : "0x00",
"storage" : {
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x7f420000000000000000000000000000000000000000000000000000000000000035600055",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,52 @@
{
"calldatasize0" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatasize0Filler.json",
"sourceHash" : "e638e627686d20765a98fa8cfab03c642bdf33216a5869e742994072c8fd051e"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x36600055",
"data" : "0x2560",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x17487699db",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x36600055",
"nonce" : "0x00",
"storage" : {
"0x00" : "0x02"
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x36600055",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,52 @@
{
"calldatasize1" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatasize1Filler.json",
"sourceHash" : "7db2dda9d80c7eac5ae82d3e2573e7f9b47ad6cb0c5545824e2500e85ec1cc3c"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x36600055",
"data" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff23",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x17487699db",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x36600055",
"nonce" : "0x00",
"storage" : {
"0x00" : "0x21"
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x36600055",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,52 @@
{
"calldatasize2" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatasize2Filler.json",
"sourceHash" : "cbd842b7c2ff77d176d3d7b5f200e908c22e47ee9a7d0f5294be85c917119f1e"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x36600055",
"data" : "0x230000000000000000000000000000000000000000000000000000000000000023",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x17487699db",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x36600055",
"nonce" : "0x00",
"storage" : {
"0x00" : "0x21"
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x36600055",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,52 @@
{
"caller" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/callerFiller.json",
"sourceHash" : "79214a9fde65ef8c878dbf8e03a06a75483536d289ad19e56b95fdef57b1da3d"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x33600055",
"data" : "0x",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x17487699db",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x33600055",
"nonce" : "0x00",
"storage" : {
"0x00" : "0xcd1722f3947def4cf144679da39c4c32bdc35681"
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x33600055",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,52 @@
{
"callvalue" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/callvalueFiller.json",
"sourceHash" : "4eabc176dc48df11702d9ddf6e8501c62035436adb16aa7cd79769ab273d583a"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x34600055",
"data" : "0x",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x17487699db",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x34600055",
"nonce" : "0x00",
"storage" : {
"0x00" : "0x0de0b6b3a7640000"
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x34600055",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,52 @@
{
"codecopy0" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/codecopy0Filler.json",
"sourceHash" : "9354634ed14a9667c8c883c3a4eceaae263bcd3d4fe47683aa0f38f45fe877e9"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x60056000600039600051600055",
"data" : "0x1234567890abcdef01234567890abcdef0",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x17487699c5",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x60056000600039600051600055",
"nonce" : "0x00",
"storage" : {
"0x00" : "0x6005600060000000000000000000000000000000000000000000000000000000"
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x60056000600039600051600055",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,51 @@
{
"codecopyZeroMemExpansion" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/codecopyZeroMemExpansionFiller.json",
"sourceHash" : "41a8841a95018c2d228db91d29d0b75992f9a166e4207362e79d17229974ddfd"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x60006000600039600051600055",
"data" : "0x1234567890abcdef01234567890abcdef0",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x174876d460",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x60006000600039600051600055",
"nonce" : "0x00",
"storage" : {
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x60006000600039600051600055",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,51 @@
{
"codecopy_DataIndexTooHigh" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/codecopy_DataIndexTooHighFiller.json",
"sourceHash" : "f6fac567f89aaca85c34c5a88b98870d1f7e2509b26ec566232c5d107741c6f4"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x60087ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600039600051600055",
"data" : "0x1234567890abcdef01234567890abcdef0",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x174876d45d",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x60087ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600039600051600055",
"nonce" : "0x00",
"storage" : {
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x60087ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600039600051600055",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,52 @@
{
"codesize" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/codesizeFiller.json",
"sourceHash" : "632259bbd9962abfa58ec3b9e7b80a8f3babcdb47592bbc511fa5e4c0bc3ce3f"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x38600055",
"data" : "0x1234567890abcdef01234567890abcdef0",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x17487699db",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x38600055",
"nonce" : "0x00",
"storage" : {
"0x00" : "0x04"
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x38600055",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,52 @@
{
"gasprice" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/gaspriceFiller.json",
"sourceHash" : "b94e3c994e54e24b85ef80fc16f53827cd26ef01fa4a96908a20e646f57d1e48"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x3a600055",
"data" : "0x1234567890abcdef01234567890abcdef0",
"gas" : "0x174876e800",
"gasPrice" : "0x075bcd15",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x17487699db",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x3a600055",
"nonce" : "0x00",
"storage" : {
"0x00" : "0x075bcd15"
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x3a600055",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -0,0 +1,52 @@
{
"origin" : {
"_info" : {
"comment" : "",
"filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2",
"lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++",
"source" : "src/VMTestsFiller/vmEnvironmentalInfo/originFiller.json",
"sourceHash" : "4d51cb9ee576e04b08a74a6a4ba3f10284ee1f735dd068abd7a0e551324f45be"
},
"callcreates" : [
],
"env" : {
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"currentDifficulty" : "0x0100",
"currentGasLimit" : "0x0f4240",
"currentNumber" : "0x00",
"currentTimestamp" : "0x01"
},
"exec" : {
"address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
"caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"code" : "0x32600055",
"data" : "0x",
"gas" : "0x174876e800",
"gasPrice" : "0x3b9aca00",
"origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681",
"value" : "0x0de0b6b3a7640000"
},
"gas" : "0x17487699db",
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"out" : "0x",
"post" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x32600055",
"nonce" : "0x00",
"storage" : {
"0x00" : "0xcd1722f3947def4cf144679da39c4c32bdc35681"
}
}
},
"pre" : {
"0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
"balance" : "0x152d02c7e14af6800000",
"code" : "0x32600055",
"nonce" : "0x00",
"storage" : {
}
}
}
}
}

@ -1,21 +1,24 @@
from mythril.laser.ethereum.evm_exceptions import VmException
from mythril.laser.ethereum.svm import LaserEVM
from mythril.laser.ethereum.state import Account
from mythril.disassembler.disassembly import Disassembly
from mythril.laser.ethereum.transaction.concolic import execute_message_call
from mythril.analysis.solver import get_model
from datetime import datetime
import binascii
import json
from pathlib import Path
import pytest
from z3 import ExprRef, simplify
evm_test_dir = Path(__file__).parent / "VMTests"
test_types = [
"vmArithmeticTest",
"vmBitwiseLogicOperation",
"vmEnvironmentalInfo",
"vmPushDupSwapTest",
"vmSha3Test",
"vmTests",
]
@ -49,7 +52,8 @@ def test_vmtest(
test_name: str, pre_condition: dict, action: dict, post_condition: dict
) -> None:
# Arrange
if test_name == "gasprice":
return
accounts = {}
for address, details in pre_condition.items():
account = Account(address)
@ -72,7 +76,7 @@ def test_vmtest(
laser_evm,
callee_address=action["address"],
caller_address=action["caller"],
origin_address=action["origin"],
origin_address=binascii.a2b_hex(action["origin"][2:]),
code=action["code"][2:],
gas=action["gas"],
data=binascii.a2b_hex(action["data"][2:]),
@ -95,9 +99,15 @@ def test_vmtest(
for index, value in details["storage"].items():
expected = int(value, 16)
if type(account.storage[int(index, 16)]) != int:
actual = model.eval(account.storage[int(index, 16)])
actual = 1 if actual == True else 0 if actual == False else actual
actual = account.storage[int(index, 16)]
if isinstance(actual, ExprRef):
actual = model.eval(actual)
actual = (
1 if actual == True else 0 if actual == False else actual
) # Comparisons should be done with == than 'is' here as actual can be a BoolRef
else:
actual = account.storage[int(index, 16)]
if type(actual) == bytes:
actual = int(binascii.b2a_hex(actual), 16)
elif type(actual) == str:
actual = int(actual, 16)
assert actual == expected

@ -2,7 +2,7 @@ import pytest
from mythril.laser.ethereum.state import Calldata
from z3 import Solver, simplify
from z3.z3types import Z3Exception
from mock import MagicMock
uninitialized_test_data = [
([]), # Empty concrete calldata
@ -17,10 +17,12 @@ def test_concrete_calldata_uninitialized_index(starting_calldata):
solver = Solver()
# Act
value = calldata[100]
value2 = calldata.get_word_at(200)
value, constraint1 = calldata[100]
value2, constraint2 = calldata.get_word_at(200)
solver.add(constraint1)
solver.add(constraint2)
solver.add(calldata.constraints)
solver.check()
model = solver.model()
@ -38,7 +40,6 @@ def test_concrete_calldata_calldatasize():
solver = Solver()
# Act
solver.add(calldata.constraints)
solver.check()
model = solver.model()
@ -54,11 +55,11 @@ def test_symbolic_calldata_constrain_index():
solver = Solver()
# Act
constraint = calldata[100] == 50
value, calldata_constraints = calldata[100]
constraint = value == 50
value = calldata[100]
solver.add([constraint] + calldata_constraints)
solver.add(calldata.constraints + [constraint])
solver.check()
model = solver.model()
@ -76,9 +77,10 @@ def test_concrete_calldata_constrain_index():
solver = Solver()
# Act
constraint = calldata[2] == 3
value, calldata_constraints = calldata[2]
constraint = value == 3
solver.add(calldata.constraints + [constraint])
solver.add([constraint] + calldata_constraints)
result = solver.check()
# Assert
@ -88,14 +90,18 @@ def test_concrete_calldata_constrain_index():
def test_concrete_calldata_constrain_index():
# Arrange
calldata = Calldata(0)
mstate = MagicMock()
mstate.constraints = []
solver = Solver()
# Act
constraints = []
constraints.append(calldata[51] == 1)
value, calldata_constraints = calldata[51]
constraints.append(value == 1)
constraints.append(calldata.calldatasize == 50)
solver.add(calldata.constraints + constraints)
solver.add(constraints + calldata_constraints)
result = solver.check()
# Assert

@ -10,9 +10,6 @@ from mythril.laser.ethereum.svm import LaserEVM
from mythril.laser.ethereum.state import WorldState, Account
import unittest.mock as mock
from unittest.mock import MagicMock
from mythril.laser.ethereum.transaction.symbolic import (
_setup_global_state_for_execution,
)
def _is_message_call(_, transaction):
@ -70,25 +67,3 @@ def test_execute_contract_creation(mocked_setup: MagicMock):
# laser_evm.exec.assert_called_once()
assert laser_evm.exec.call_count == 1
assert len(laser_evm.open_states) == 0
def test_calldata_constraints_in_transaction():
# Arrange
laser_evm = LaserEVM({})
world_state = WorldState()
correct_constraints = [MagicMock(), MagicMock(), MagicMock()]
transaction = MessageCallTransaction(
world_state, Account("ca11ee"), Account("ca114")
)
transaction.call_data = MagicMock()
transaction.call_data.constraints = correct_constraints
# Act
_setup_global_state_for_execution(laser_evm, transaction)
# Assert
state = laser_evm.work_list[0]
for constraint in correct_constraints:
assert constraint in state.environment.calldata.constraints

@ -112,8 +112,9 @@ class NativeTests(BaseTestCase):
account = Account("0x0000000000000000000000000000000000000000", disassembly)
accounts = {account.address: account}
laser = svm.LaserEVM(accounts, max_depth=100)
laser = svm.LaserEVM(accounts, max_depth=100, max_transaction_count=1)
laser.sym_exec(account.address)
laser_info = str(_all_info(laser))
print("\n")

@ -29,6 +29,7 @@ def _generate_report(input_file):
address=(util.get_indexed_address(0)),
strategy="dfs",
execution_timeout=30,
max_transaction_count=1,
)
issues = fire_lasers(sym)
@ -99,6 +100,7 @@ def _assert_empty_json(changed_files):
if not ordered(output_expected.items()) == ordered(output_current.items()):
expected.append(output_expected)
actual.append(output_current)
print("Found difference in {}".format(str(input_file)))
assert expected == actual

@ -82,7 +82,7 @@ class SVMTestCase(BaseTestCase):
account = Account("0x0000000000000000000000000000000000000000", disassembly)
accounts = {account.address: account}
laser = svm.LaserEVM(accounts, max_depth=22)
laser = svm.LaserEVM(accounts, max_depth=22, max_transaction_count=1)
laser.sym_exec(account.address)
laser_info = _all_info(laser)

@ -1 +1 @@
{"error": null, "issues": [{"address": 661, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "This contract executes a message call to to another contract. Make sure that the called contract is trusted and does not execute user-supplied code.", "function": "_function_0x5a6814ec", "swc_id": "107", "title": "Message call to external contract", "type": "Informational"}, {"address": 666, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "The return value of an external call is not checked. Note that execution continue even if the called contract throws.", "function": "_function_0x5a6814ec", "swc_id": "104", "title": "Unchecked CALL return value", "type": "Informational"}, {"address": 779, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "This contract executes a message call to an address found at storage slot 1. This storage slot can be written to by calling the function `_function_0x2776b163`. Generally, it is not recommended to call user-supplied addresses using Solidity's call() construct. Note that attackers might leverage reentrancy attacks to exploit race conditions or manipulate this contract's state.", "function": "_function_0xd24b08cc", "swc_id": "107", "title": "Message call to external contract", "type": "Warning"}, {"address": 779, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "Possible transaction order dependence vulnerability: The value or direction of the call statement is determined from a tainted storage location", "function": "_function_0xd24b08cc", "swc_id": "114", "title": "Transaction order dependence", "type": "Warning"}, {"address": 784, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "The return value of an external call is not checked. Note that execution continue even if the called contract throws.", "function": "_function_0xd24b08cc", "swc_id": "104", "title": "Unchecked CALL return value", "type": "Informational"}, {"address": 858, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "This contract executes a message call to to another contract. Make sure that the called contract is trusted and does not execute user-supplied code.", "function": "_function_0xe11f493e", "swc_id": "107", "title": "Message call to external contract", "type": "Informational"}, {"address": 869, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "The contract account state is changed after an external call. Consider that the called contract could re-enter the function before this state change takes place. This can lead to business logic vulnerabilities.", "function": "_function_0xe11f493e", "swc_id": "107", "title": "State change after external call", "type": "Warning"}, {"address": 871, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "The return value of an external call is not checked. Note that execution continue even if the called contract throws.", "function": "_function_0xe11f493e", "swc_id": "104", "title": "Unchecked CALL return value", "type": "Informational"}, {"address": 912, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "This contract executes a message call to an address provided as a function argument. Generally, it is not recommended to call user-supplied addresses using Solidity's call() construct. Note that attackers might leverage reentrancy attacks to exploit race conditions or manipulate this contract's state.", "function": "_function_0xe1d10f79", "swc_id": "107", "title": "Message call to external contract", "type": "Warning"}, {"address": 918, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "The return value of an external call is not checked. Note that execution continue even if the called contract throws.", "function": "_function_0xe1d10f79", "swc_id": "104", "title": "Unchecked CALL return value", "type": "Informational"}], "success": true}
{"error": null, "issues": [{"address": 661, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "This contract executes a message call to to another contract. Make sure that the called contract is trusted and does not execute user-supplied code.", "function": "_function_0x5a6814ec", "swc-id": "107", "title": "Message call to external contract", "type": "Informational"}, {"address": 666, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "The return value of an external call is not checked. Note that execution continue even if the called contract throws.", "function": "_function_0x5a6814ec", "swc-id": "104", "title": "Unchecked CALL return value", "type": "Informational"}, {"address": 779, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "This contract executes a message call to an address found at storage slot 1. This storage slot can be written to by calling the function `_function_0x2776b163`. Generally, it is not recommended to call user-supplied addresses using Solidity's call() construct. Note that attackers might leverage reentrancy attacks to exploit race conditions or manipulate this contract's state.", "function": "_function_0xd24b08cc", "swc-id": "107", "title": "Message call to external contract", "type": "Warning"}, {"address": 779, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "Possible transaction order dependence vulnerability: The value or direction of the call statement is determined from a tainted storage location", "function": "_function_0xd24b08cc", "swc-id": "114", "title": "Transaction order dependence", "type": "Warning"}, {"address": 784, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "The return value of an external call is not checked. Note that execution continue even if the called contract throws.", "function": "_function_0xd24b08cc", "swc-id": "104", "title": "Unchecked CALL return value", "type": "Informational"}, {"address": 858, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "This contract executes a message call to to another contract. Make sure that the called contract is trusted and does not execute user-supplied code.", "function": "_function_0xe11f493e", "swc-id": "107", "title": "Message call to external contract", "type": "Informational"}, {"address": 869, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "The contract account state is changed after an external call. Consider that the called contract could re-enter the function before this state change takes place. This can lead to business logic vulnerabilities.", "function": "_function_0xe11f493e", "swc-id": "107", "title": "State change after external call", "type": "Warning"}, {"address": 871, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "The return value of an external call is not checked. Note that execution continue even if the called contract throws.", "function": "_function_0xe11f493e", "swc-id": "104", "title": "Unchecked CALL return value", "type": "Informational"}, {"address": 912, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "This contract executes a message call to an address provided as a function argument. Generally, it is not recommended to call user-supplied addresses using Solidity's call() construct. Note that attackers might leverage reentrancy attacks to exploit race conditions or manipulate this contract's state.", "function": "_function_0xe1d10f79", "swc-id": "107", "title": "Message call to external contract", "type": "Warning"}, {"address": 918, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "The return value of an external call is not checked. Note that execution continue even if the called contract throws.", "function": "_function_0xe1d10f79", "swc-id": "104", "title": "Unchecked CALL return value", "type": "Informational"}], "success": true}

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

File diff suppressed because one or more lines are too long

@ -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": "Users other than the contract creator can withdraw ETH from the contract account without previously having sent any ETH to it. This is likely to be vulnerability.", "function": "withdrawfunds()", "swc-id": "105", "title": "Ether thief", "type": "Warning"}, {"address": 883, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "This binary add operation can result in integer overflow.\n", "function": "invest()", "swc-id": "101", "title": "Integer Overflow", "type": "Warning"}], "success": true}

@ -1,6 +1,6 @@
# Analysis results for test-filename.sol
## Ether send
## Ether thief
- SWC ID: 105
- Type: Warning
- Contract: Unknown
@ -9,7 +9,7 @@
### 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.
Users other than the contract creator can withdraw ETH from the contract account without previously having sent any ETH to it. This is likely to be vulnerability.
## Integer Overflow
- SWC ID: 101
@ -20,4 +20,4 @@ It seems that an attacker is able to execute an call instruction, this can mean
### Description
The arithmetic operation can result in integer overflow.
This binary add operation can result in integer overflow.

@ -1,10 +1,10 @@
==== Ether send ====
==== Ether thief ====
SWC ID: 105
Type: Warning
Contract: Unknown
Function name: withdrawfunds()
PC address: 722
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.
Users other than the contract creator can withdraw ETH from the contract account without previously having sent any ETH to it. This is likely to be vulnerability.
--------------------
==== Integer Overflow ====
@ -13,7 +13,7 @@ Type: Warning
Contract: Unknown
Function name: invest()
PC address: 883
The arithmetic operation can result in integer overflow.
This binary add operation can result in integer overflow.
--------------------

@ -1 +1 @@
{"error": null, "issues": [{"address": 446, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "A reachable exception (opcode 0xfe) has been detected. This can be caused by type errors, division by zero, out-of-bounds array access, or assert violations. Note that explicit `assert()` should only be used to check invariants. Use `require()` for regular input checking. ", "function": "_function_0x546455b5", "swc_id": "110", "title": "Exception state", "type": "Informational"}, {"address": 484, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "A reachable exception (opcode 0xfe) has been detected. This can be caused by type errors, division by zero, out-of-bounds array access, or assert violations. Note that explicit `assert()` should only be used to check invariants. Use `require()` for regular input checking. ", "function": "_function_0x92dd38ea", "swc_id": "110", "title": "Exception state", "type": "Informational"}, {"address": 506, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "A reachable exception (opcode 0xfe) has been detected. This can be caused by type errors, division by zero, out-of-bounds array access, or assert violations. Note that explicit `assert()` should only be used to check invariants. Use `require()` for regular input checking. ", "function": "_function_0xa08299f1", "swc_id": "110", "title": "Exception state", "type": "Informational"}, {"address": 531, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "A reachable exception (opcode 0xfe) has been detected. This can be caused by type errors, division by zero, out-of-bounds array access, or assert violations. Note that explicit `assert()` should only be used to check invariants. Use `require()` for regular input checking. ", "function": "_function_0xb34c3610", "swc_id": "110", "title": "Exception state", "type": "Informational"}], "success": true}
{"error": null, "issues": [{"address": 446, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "A reachable exception (opcode 0xfe) has been detected. This can be caused by type errors, division by zero, out-of-bounds array access, or assert violations. Note that explicit `assert()` should only be used to check invariants. Use `require()` for regular input checking. ", "function": "_function_0x546455b5", "swc-id": "110", "title": "Exception state", "type": "Informational"}, {"address": 484, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "A reachable exception (opcode 0xfe) has been detected. This can be caused by type errors, division by zero, out-of-bounds array access, or assert violations. Note that explicit `assert()` should only be used to check invariants. Use `require()` for regular input checking. ", "function": "_function_0x92dd38ea", "swc-id": "110", "title": "Exception state", "type": "Informational"}, {"address": 506, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "A reachable exception (opcode 0xfe) has been detected. This can be caused by type errors, division by zero, out-of-bounds array access, or assert violations. Note that explicit `assert()` should only be used to check invariants. Use `require()` for regular input checking. ", "function": "_function_0xa08299f1", "swc-id": "110", "title": "Exception state", "type": "Informational"}, {"address": 531, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "A reachable exception (opcode 0xfe) has been detected. This can be caused by type errors, division by zero, out-of-bounds array access, or assert violations. Note that explicit `assert()` should only be used to check invariants. Use `require()` for regular input checking. ", "function": "_function_0xb34c3610", "swc-id": "110", "title": "Exception state", "type": "Informational"}], "success": true}

@ -1 +1 @@
{"error": null, "issues": [{"address": 626, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "The return value of an external call is not checked. Note that execution continue even if the called contract throws.", "function": "_function_0x141f32ff", "swc_id": "104", "title": "Unchecked CALL return value", "type": "Informational"}, {"address": 857, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "The return value of an external call is not checked. Note that execution continue even if the called contract throws.", "function": "_function_0x9b58bc26", "swc_id": "104", "title": "Unchecked CALL return value", "type": "Informational"}, {"address": 1038, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "This contract executes a message call to an address provided as a function argument. Generally, it is not recommended to call user-supplied addresses using Solidity's call() construct. Note that attackers might leverage reentrancy attacks to exploit race conditions or manipulate this contract's state.", "function": "_function_0xeea4c864", "swc_id": "107", "title": "Message call to external contract", "type": "Warning"}, {"address": 1046, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "The return value of an external call is not checked. Note that execution continue even if the called contract throws.", "function": "_function_0xeea4c864", "swc_id": "104", "title": "Unchecked CALL return value", "type": "Informational"}], "success": true}
{"error": null, "issues": [{"address": 626, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "The return value of an external call is not checked. Note that execution continue even if the called contract throws.", "function": "_function_0x141f32ff", "swc-id": "104", "title": "Unchecked CALL return value", "type": "Informational"}, {"address": 857, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "The return value of an external call is not checked. Note that execution continue even if the called contract throws.", "function": "_function_0x9b58bc26", "swc-id": "104", "title": "Unchecked CALL return value", "type": "Informational"}, {"address": 1038, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "This contract executes a message call to an address provided as a function argument. Generally, it is not recommended to call user-supplied addresses using Solidity's call() construct. Note that attackers might leverage reentrancy attacks to exploit race conditions or manipulate this contract's state.", "function": "_function_0xeea4c864", "swc-id": "107", "title": "Message call to external contract", "type": "Warning"}, {"address": 1046, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "The return value of an external call is not checked. Note that execution continue even if the called contract throws.", "function": "_function_0xeea4c864", "swc-id": "104", "title": "Unchecked CALL return value", "type": "Informational"}], "success": true}

File diff suppressed because one or more lines are too long

@ -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": "Users other than the contract creator can withdraw ETH from the contract account without previously having sent any ETH to it. This is likely to be vulnerability.", "function": "_function_0x8a4068dd", "swc-id": "105", "title": "Ether thief", "type": "Warning"}], "success": true}

@ -1,6 +1,6 @@
# Analysis results for test-filename.sol
## Ether send
## Ether thief
- SWC ID: 105
- Type: Warning
- Contract: Unknown
@ -9,4 +9,4 @@
### 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.
Users other than the contract creator can withdraw ETH from the contract account without previously having sent any ETH to it. This is likely to be vulnerability.

@ -1,9 +1,9 @@
==== Ether send ====
==== Ether thief ====
SWC ID: 105
Type: Warning
Contract: Unknown
Function name: _function_0x8a4068dd
PC address: 142
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.
Users other than the contract creator can withdraw ETH from the contract account without previously having sent any ETH to it. This is likely to be vulnerability.
--------------------

@ -1 +1 @@
{"error": null, "issues": [{"address": 317, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "The function `transferOwnership(address)` retrieves the transaction origin (tx.origin) using the ORIGIN opcode. Use msg.sender instead.\nSee also: https://solidity.readthedocs.io/en/develop/security-considerations.html#tx-origin", "function": "transferOwnership(address)", "swc_id": "115", "title": "Use of tx.origin", "type": "Warning"}], "success": true}
{"error": null, "issues": [{"address": 317, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "The function `transferOwnership(address)` retrieves the transaction origin (tx.origin) using the ORIGIN opcode. Use msg.sender instead.\nSee also: https://solidity.readthedocs.io/en/develop/security-considerations.html#tx-origin", "function": "transferOwnership(address)", "swc-id": "115", "title": "Use of tx.origin", "type": "Warning"}], "success": true}

@ -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":"This binary add operation can result in integer overflow.\n","function":"sendeth(address,uint256)","swc-id":"101","title":"Integer Overflow","type":"Warning"}],"success":true}

@ -31,4 +31,4 @@ The subtraction can result in an integer underflow.
### Description
The arithmetic operation can result in integer overflow.
This binary add operation can result in integer overflow.

@ -24,7 +24,7 @@ Type: Warning
Contract: Unknown
Function name: sendeth(address,uint256)
PC address: 725
The arithmetic operation can result in integer overflow.
This binary add operation can result in integer overflow.
--------------------

@ -1 +1 @@
{"error": null, "issues": [{"address": 196, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "This contract executes a message call to to another contract. Make sure that the called contract is trusted and does not execute user-supplied code.", "function": "_function_0x633ab5e0", "swc_id": "107", "title": "Message call to external contract", "type": "Informational"}, {"address": 285, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "This contract executes a message call to to another contract. Make sure that the called contract is trusted and does not execute user-supplied code.", "function": "_function_0xe3bea282", "swc_id": "107", "title": "Message call to external contract", "type": "Informational"}, {"address": 290, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "The return value of an external call is not checked. Note that execution continue even if the called contract throws.", "function": "_function_0xe3bea282", "swc_id": "104", "title": "Unchecked CALL return value", "type": "Informational"}], "success": true}
{"error": null, "issues": [{"address": 196, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "This contract executes a message call to to another contract. Make sure that the called contract is trusted and does not execute user-supplied code.", "function": "_function_0x633ab5e0", "swc-id": "107", "title": "Message call to external contract", "type": "Informational"}, {"address": 285, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "This contract executes a message call to to another contract. Make sure that the called contract is trusted and does not execute user-supplied code.", "function": "_function_0xe3bea282", "swc-id": "107", "title": "Message call to external contract", "type": "Informational"}, {"address": 290, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "The return value of an external call is not checked. Note that execution continue even if the called contract throws.", "function": "_function_0xe3bea282", "swc-id": "104", "title": "Unchecked CALL return value", "type": "Informational"}], "success": true}

@ -24,8 +24,8 @@
<script>
var options = {"autoResize": true, "edges": {"font": {"align": "horizontal", "background": "none", "color": "#FFFFFF", "face": "arial", "multi": false, "strokeColor": "#ffffff", "strokeWidth": 0, "vadjust": 0}}, "height": "100%", "layout": {"hierarchical": {"blockShifting": true, "direction": "LR", "edgeMinimization": true, "enabled": true, "levelSeparation": 450, "nodeSpacing": 200, "parentCentralization": false, "sortMethod": "directed", "treeSpacing": 100}, "improvedLayout": true}, "manipulation": false, "nodes": {"borderWidth": 1, "borderWidthSelected": 2, "chosen": true, "color": "#000000", "font": {"align": "left", "color": "#FFFFFF"}, "shape": "box"}, "physics": {"enabled": false}, "width": "100%"};
var nodes = [{"color": {"background": "#2f7e5b", "border": "#26996f", "highlight": {"background": "#28a16f", "border": "#26996f"}}, "fullLabel": "0 PUSH1 0x60\n2 PUSH1 0x40\n4 MSTORE\n5 PUSH1 0x04\n7 CALLDATASIZE\n8 LT\n9 PUSH1 0x3f\n11 JUMPI", "id": "57", "isExpanded": false, "label": "0 PUSH1 0x60\n2 PUSH1 0x40\n4 MSTORE\n5 PUSH1 0x04\n7 CALLDATASIZE\n8 LT\n(click to expand +)", "size": 150, "truncLabel": "0 PUSH1 0x60\n2 PUSH1 0x40\n4 MSTORE\n5 PUSH1 0x04\n7 CALLDATASIZE\n8 LT\n(click to expand +)"}, {"color": {"background": "#2f7e5b", "border": "#26996f", "highlight": {"background": "#28a16f", "border": "#26996f"}}, "fullLabel": "12 PUSH1 0x00\n14 CALLDATALOAD\n15 PUSH29 0x01000000(...)\n45 SWAP1\n46 DIV\n47 PUSH4 0xffffffff\n52 AND\n53 DUP1\n54 PUSH4 0xcbf0b0c0\n59 EQ\n60 PUSH1 0x44\n62 JUMPI", "id": "58", "isExpanded": false, "label": "12 PUSH1 0x00\n14 CALLDATALOAD\n15 PUSH29 0x01000000(...)\n45 SWAP1\n46 DIV\n47 PUSH4 0xffffffff\n(click to expand +)", "size": 150, "truncLabel": "12 PUSH1 0x00\n14 CALLDATALOAD\n15 PUSH29 0x01000000(...)\n45 SWAP1\n46 DIV\n47 PUSH4 0xffffffff\n(click to expand +)"}, {"color": {"background": "#2f7e5b", "border": "#26996f", "highlight": {"background": "#28a16f", "border": "#26996f"}}, "fullLabel": "63 JUMPDEST\n64 PUSH1 0x00\n66 DUP1\n67 REVERT", "id": "59", "isExpanded": false, "label": "63 JUMPDEST\n64 PUSH1 0x00\n66 DUP1\n67 REVERT", "size": 150, "truncLabel": "63 JUMPDEST\n64 PUSH1 0x00\n66 DUP1\n67 REVERT"}, {"color": {"background": "#2f7e5b", "border": "#26996f", "highlight": {"background": "#28a16f", "border": "#26996f"}}, "fullLabel": "63 JUMPDEST\n64 PUSH1 0x00\n66 DUP1\n67 REVERT", "id": "60", "isExpanded": false, "label": "63 JUMPDEST\n64 PUSH1 0x00\n66 DUP1\n67 REVERT", "size": 150, "truncLabel": "63 JUMPDEST\n64 PUSH1 0x00\n66 DUP1\n67 REVERT"}, {"color": {"background": "#2f7e5b", "border": "#26996f", "highlight": {"background": "#28a16f", "border": "#26996f"}}, "fullLabel": "68 JUMPDEST\n69 CALLVALUE\n70 ISZERO\n71 PUSH1 0x4e\n73 JUMPI", "id": "61", "isExpanded": false, "label": "68 JUMPDEST\n69 CALLVALUE\n70 ISZERO\n71 PUSH1 0x4e\n73 JUMPI", "size": 150, "truncLabel": "68 JUMPDEST\n69 CALLVALUE\n70 ISZERO\n71 PUSH1 0x4e\n73 JUMPI"}, {"color": {"background": "#2f7e5b", "border": "#26996f", "highlight": {"background": "#28a16f", "border": "#26996f"}}, "fullLabel": "74 PUSH1 0x00\n76 DUP1\n77 REVERT", "id": "62", "isExpanded": false, "label": "74 PUSH1 0x00\n76 DUP1\n77 REVERT", "size": 150, "truncLabel": "74 PUSH1 0x00\n76 DUP1\n77 REVERT"}, {"color": {"background": "#2f7e5b", "border": "#26996f", "highlight": {"background": "#28a16f", "border": "#26996f"}}, "fullLabel": "78 JUMPDEST\n79 PUSH1 0x78\n81 PUSH1 0x04\n83 DUP1\n84 DUP1\n85 CALLDATALOAD\n86 PUSH20 0xffffffff(...)\n107 AND\n108 SWAP1\n109 PUSH1 0x20\n111 ADD\n112 SWAP1\n113 SWAP2\n114 SWAP1\n115 POP\n116 POP\n117 PUSH1 0x7a\n119 JUMP", "id": "63", "isExpanded": false, "label": "78 JUMPDEST\n79 PUSH1 0x78\n81 PUSH1 0x04\n83 DUP1\n84 DUP1\n85 CALLDATALOAD\n(click to expand +)", "size": 150, "truncLabel": "78 JUMPDEST\n79 PUSH1 0x78\n81 PUSH1 0x04\n83 DUP1\n84 DUP1\n85 CALLDATALOAD\n(click to expand +)"}, {"color": {"background": "#2f7e5b", "border": "#26996f", "highlight": {"background": "#28a16f", "border": "#26996f"}}, "fullLabel": "122 JUMPDEST\n123 DUP1\n124 PUSH20 0xffffffff(...)\n145 AND\n146 SUICIDE", "id": "64", "isExpanded": false, "label": "122 JUMPDEST\n123 DUP1\n124 PUSH20 0xffffffff(...)\n145 AND\n146 SUICIDE", "size": 150, "truncLabel": "122 JUMPDEST\n123 DUP1\n124 PUSH20 0xffffffff(...)\n145 AND\n146 SUICIDE"}];
var edges = [{"arrows": "to", "from": "57", "label": "ULE(4, 3_calldatasize)", "smooth": {"type": "cubicBezier"}, "to": "58"}, {"arrows": "to", "from": "57", "label": "Not(ULE(4, 3_calldatasize))", "smooth": {"type": "cubicBezier"}, "to": "59"}, {"arrows": "to", "from": "58", "label": "Not(And(3_calldata[3] == 0xc0, 3_calldata[2] == 0xb0, 3_calldata[1] == 0xf0, 3_calldata[0] == 0xcb))", "smooth": {"type": "cubicBezier"}, "to": "60"}, {"arrows": "to", "from": "58", "label": "And(3_calldata[3] == 0xc0, 3_calldata[2] == 0xb0, 3_calldata[1] == 0xf0, 3_calldata[0] == 0xcb)", "smooth": {"type": "cubicBezier"}, "to": "61"}, {"arrows": "to", "from": "61", "label": "Not(call_value3 == 0)", "smooth": {"type": "cubicBezier"}, "to": "62"}, {"arrows": "to", "from": "61", "label": "call_value3 == 0", "smooth": {"type": "cubicBezier"}, "to": "63"}, {"arrows": "to", "from": "63", "label": "", "smooth": {"type": "cubicBezier"}, "to": "64"}];
var nodes = [{"color": {"background": "#2f7e5b", "border": "#26996f", "highlight": {"background": "#28a16f", "border": "#26996f"}}, "fullLabel": "0 PUSH1 0x60\n2 PUSH1 0x40\n4 MSTORE\n5 PUSH1 0x04\n7 CALLDATASIZE\n8 LT\n9 PUSH1 0x3f\n11 JUMPI", "id": "700", "isExpanded": false, "label": "0 PUSH1 0x60\n2 PUSH1 0x40\n4 MSTORE\n5 PUSH1 0x04\n7 CALLDATASIZE\n8 LT\n(click to expand +)", "size": 150, "truncLabel": "0 PUSH1 0x60\n2 PUSH1 0x40\n4 MSTORE\n5 PUSH1 0x04\n7 CALLDATASIZE\n8 LT\n(click to expand +)"}, {"color": {"background": "#2f7e5b", "border": "#26996f", "highlight": {"background": "#28a16f", "border": "#26996f"}}, "fullLabel": "12 PUSH1 0x00\n14 CALLDATALOAD\n15 PUSH29 0x01000000(...)\n45 SWAP1\n46 DIV\n47 PUSH4 0xffffffff\n52 AND\n53 DUP1\n54 PUSH4 0xcbf0b0c0\n59 EQ\n60 PUSH1 0x44\n62 JUMPI", "id": "701", "isExpanded": false, "label": "12 PUSH1 0x00\n14 CALLDATALOAD\n15 PUSH29 0x01000000(...)\n45 SWAP1\n46 DIV\n47 PUSH4 0xffffffff\n(click to expand +)", "size": 150, "truncLabel": "12 PUSH1 0x00\n14 CALLDATALOAD\n15 PUSH29 0x01000000(...)\n45 SWAP1\n46 DIV\n47 PUSH4 0xffffffff\n(click to expand +)"}, {"color": {"background": "#2f7e5b", "border": "#26996f", "highlight": {"background": "#28a16f", "border": "#26996f"}}, "fullLabel": "63 JUMPDEST\n64 PUSH1 0x00\n66 DUP1\n67 REVERT", "id": "702", "isExpanded": false, "label": "63 JUMPDEST\n64 PUSH1 0x00\n66 DUP1\n67 REVERT", "size": 150, "truncLabel": "63 JUMPDEST\n64 PUSH1 0x00\n66 DUP1\n67 REVERT"}, {"color": {"background": "#2f7e5b", "border": "#26996f", "highlight": {"background": "#28a16f", "border": "#26996f"}}, "fullLabel": "63 JUMPDEST\n64 PUSH1 0x00\n66 DUP1\n67 REVERT", "id": "703", "isExpanded": false, "label": "63 JUMPDEST\n64 PUSH1 0x00\n66 DUP1\n67 REVERT", "size": 150, "truncLabel": "63 JUMPDEST\n64 PUSH1 0x00\n66 DUP1\n67 REVERT"}, {"color": {"background": "#2f7e5b", "border": "#26996f", "highlight": {"background": "#28a16f", "border": "#26996f"}}, "fullLabel": "68 JUMPDEST\n69 CALLVALUE\n70 ISZERO\n71 PUSH1 0x4e\n73 JUMPI", "id": "704", "isExpanded": false, "label": "68 JUMPDEST\n69 CALLVALUE\n70 ISZERO\n71 PUSH1 0x4e\n73 JUMPI", "size": 150, "truncLabel": "68 JUMPDEST\n69 CALLVALUE\n70 ISZERO\n71 PUSH1 0x4e\n73 JUMPI"}, {"color": {"background": "#2f7e5b", "border": "#26996f", "highlight": {"background": "#28a16f", "border": "#26996f"}}, "fullLabel": "74 PUSH1 0x00\n76 DUP1\n77 REVERT", "id": "705", "isExpanded": false, "label": "74 PUSH1 0x00\n76 DUP1\n77 REVERT", "size": 150, "truncLabel": "74 PUSH1 0x00\n76 DUP1\n77 REVERT"}, {"color": {"background": "#2f7e5b", "border": "#26996f", "highlight": {"background": "#28a16f", "border": "#26996f"}}, "fullLabel": "78 JUMPDEST\n79 PUSH1 0x78\n81 PUSH1 0x04\n83 DUP1\n84 DUP1\n85 CALLDATALOAD\n86 PUSH20 0xffffffff(...)\n107 AND\n108 SWAP1\n109 PUSH1 0x20\n111 ADD\n112 SWAP1\n113 SWAP2\n114 SWAP1\n115 POP\n116 POP\n117 PUSH1 0x7a\n119 JUMP", "id": "706", "isExpanded": false, "label": "78 JUMPDEST\n79 PUSH1 0x78\n81 PUSH1 0x04\n83 DUP1\n84 DUP1\n85 CALLDATALOAD\n(click to expand +)", "size": 150, "truncLabel": "78 JUMPDEST\n79 PUSH1 0x78\n81 PUSH1 0x04\n83 DUP1\n84 DUP1\n85 CALLDATALOAD\n(click to expand +)"}, {"color": {"background": "#2f7e5b", "border": "#26996f", "highlight": {"background": "#28a16f", "border": "#26996f"}}, "fullLabel": "122 JUMPDEST\n123 DUP1\n124 PUSH20 0xffffffff(...)\n145 AND\n146 SUICIDE", "id": "707", "isExpanded": false, "label": "122 JUMPDEST\n123 DUP1\n124 PUSH20 0xffffffff(...)\n145 AND\n146 SUICIDE", "size": 150, "truncLabel": "122 JUMPDEST\n123 DUP1\n124 PUSH20 0xffffffff(...)\n145 AND\n146 SUICIDE"}];
var edges = [{"arrows": "to", "from": "700", "label": "ULE(4, 11_calldatasize)", "smooth": {"type": "cubicBezier"}, "to": "701"}, {"arrows": "to", "from": "700", "label": "Not(ULE(4, 11_calldatasize))", "smooth": {"type": "cubicBezier"}, "to": "702"}, {"arrows": "to", "from": "701", "label": "Not(And(11_calldata[3] == 0xc0, 11_calldata[2] == 0xb0, 11_calldata[1] == 0xf0, 11_calldata[0] == 0xcb))", "smooth": {"type": "cubicBezier"}, "to": "703"}, {"arrows": "to", "from": "701", "label": "And(11_calldata[3] == 0xc0, 11_calldata[2] == 0xb0, 11_calldata[1] == 0xf0, 11_calldata[0] == 0xcb)", "smooth": {"type": "cubicBezier"}, "to": "704"}, {"arrows": "to", "from": "704", "label": "Not(call_value11 == 0)", "smooth": {"type": "cubicBezier"}, "to": "705"}, {"arrows": "to", "from": "704", "label": "call_value11 == 0", "smooth": {"type": "cubicBezier"}, "to": "706"}, {"arrows": "to", "from": "706", "label": "", "smooth": {"type": "cubicBezier"}, "to": "707"}];
</script>
</head>
<body>
@ -59,4 +59,4 @@
});
</script>
</body>
</html>
</html>

@ -1 +1 @@
{"error": null, "issues": [{"address": 146, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "A reachable SUICIDE instruction was detected. The remaining Ether is sent to an address provided as a function argument.\n", "function": "_function_0xcbf0b0c0", "swc_id": "106", "title": "Unchecked SUICIDE", "type": "Warning"}], "success": true}
{"error": null, "issues": [{"address": 146, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "A reachable SUICIDE instruction was detected. The remaining Ether is sent to an address provided as a function argument.\n", "function": "_function_0xcbf0b0c0", "swc-id": "106", "title": "Unchecked SUICIDE", "type": "Warning"}], "success": true}

File diff suppressed because one or more lines are too long

@ -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": "This binary add operation can result in integer overflow.\n", "function": "sendeth(address,uint256)", "swc-id": "101", "title": "Integer Overflow", "type": "Warning"}], "success": true}

@ -31,4 +31,4 @@ The subtraction can result in an integer underflow.
### Description
The arithmetic operation can result in integer overflow.
This binary add operation can result in integer overflow.

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save