Merge branch 'develop' into berndtz_experimental

berndtz_experimental
Bernhard Mueller 6 years ago
commit d020d693ab
  1. 10
      mythril/analysis/modules/suicide.py

@ -4,6 +4,7 @@ from mythril.analysis.swc_data import UNPROTECTED_SELFDESTRUCT
from mythril.exceptions import UnsatError
from mythril.analysis.modules.base import DetectionModule
from mythril.laser.ethereum.state.global_state import GlobalState
from mythril.laser.ethereum.transaction.symbolic import ATTACKER_ADDRESS
import logging
import json
@ -57,13 +58,16 @@ class SuicideModule(DetectionModule):
)
description_head = "The contract can be killed by anyone."
caller = state.current_transaction.caller
try:
try:
transaction_sequence = solver.get_transaction_sequence(
state,
state.mstate.constraints
+ [to == 0xDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF],
+ [
to == 0xDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF,
caller == ATTACKER_ADDRESS,
],
)
description_tail = (
"Anyone can kill this contract and withdraw its balance to an arbitrary "
@ -71,7 +75,7 @@ class SuicideModule(DetectionModule):
)
except UnsatError:
transaction_sequence = solver.get_transaction_sequence(
state, state.mstate.constraints
state, state.mstate.constraints + [caller == ATTACKER_ADDRESS]
)
description_tail = "Arbitrary senders can kill this contract."

Loading…
Cancel
Save