Fix log line, update test outputs

pull/755/head
Bernhard Mueller 6 years ago
parent d96b9c2c77
commit 80c7e75862
  1. 8
      mythril/analysis/modules/suicide.py
  2. 19
      tests/testdata/outputs_expected/suicide.sol.o.json
  3. 2
      tests/testdata/outputs_expected/suicide.sol.o.markdown
  4. 3
      tests/testdata/outputs_expected/suicide.sol.o.text

@ -62,12 +62,6 @@ class SuicideModule(DetectionModule):
return [] return []
try: try:
model = solver.get_model(constraints)
logging.debug(
"[SUICIDE] SUICIDE instruction is callable by anyone "
+ node.function_name
)
try: try:
transaction_sequence = solver.get_transaction_sequence( transaction_sequence = solver.get_transaction_sequence(
state, constraints + [to == ARBITRARY_SENDER_ADDRESS] state, constraints + [to == ARBITRARY_SENDER_ADDRESS]
@ -99,7 +93,7 @@ class SuicideModule(DetectionModule):
) )
issues.append(issue) issues.append(issue)
except UnsatError: except UnsatError:
logging.debug("[UNCHECKED_SUICIDE] no model found") logging.debug("[SUICIDE] no model found")
return issues return issues

@ -1,18 +1 @@
{ {"error": null, "issues": [{"address": 146, "contract": "Unknown", "debug": "<DEBUG-DATA>", "description": "The contract can be killed by anyone and the attacker can withdraw its balance.", "function": "kill(address)", "max_gas_used": 263, "min_gas_used": 168, "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": "kill(address)",
"swc-id": "106",
"min_gas_used": 168,
"max_gas_used": 263,
"title": "Unchecked SUICIDE",
"type": "Warning"
}
],
"success": true
}

@ -10,4 +10,4 @@
### Description ### Description
A reachable SUICIDE instruction was detected. The remaining Ether is sent to an address provided as a function argument. The contract can be killed by anyone and the attacker can withdraw its balance.

@ -5,7 +5,6 @@ Contract: Unknown
Function name: kill(address) Function name: kill(address)
PC address: 146 PC address: 146
Estimated Gas Usage: 168 - 263 Estimated Gas Usage: 168 - 263
A reachable SUICIDE instruction was detected. The remaining Ether is sent to an address provided as a function argument. The contract can be killed by anyone and the attacker can withdraw its balance.
-------------------- --------------------

Loading…
Cancel
Save