|
|
@ -9,7 +9,6 @@ from mythril.laser.ethereum.cfg import Node |
|
|
|
from mythril.laser.ethereum.state.environment import Environment |
|
|
|
from mythril.laser.ethereum.state.environment import Environment |
|
|
|
from mythril.laser.ethereum.state.machine_state import MachineState |
|
|
|
from mythril.laser.ethereum.state.machine_state import MachineState |
|
|
|
from mythril.laser.ethereum.state.annotation import StateAnnotation |
|
|
|
from mythril.laser.ethereum.state.annotation import StateAnnotation |
|
|
|
from mythril.laser.ethereum.evm_exceptions import ProgramCounterException |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if TYPE_CHECKING: |
|
|
|
if TYPE_CHECKING: |
|
|
|
from mythril.laser.ethereum.state.world_state import WorldState |
|
|
|
from mythril.laser.ethereum.state.world_state import WorldState |
|
|
@ -95,13 +94,12 @@ class GlobalState: |
|
|
|
|
|
|
|
|
|
|
|
:return: |
|
|
|
:return: |
|
|
|
""" |
|
|
|
""" |
|
|
|
|
|
|
|
|
|
|
|
instructions = self.environment.code.instruction_list |
|
|
|
instructions = self.environment.code.instruction_list |
|
|
|
if self.mstate.pc >= len(instructions): |
|
|
|
try: |
|
|
|
raise ProgramCounterException( |
|
|
|
|
|
|
|
"PC: {} can not be reached.".format(self.mstate.pc) |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
return instructions[self.mstate.pc] |
|
|
|
return instructions[self.mstate.pc] |
|
|
|
|
|
|
|
except KeyError: |
|
|
|
|
|
|
|
new_instruction = {"address": self.mstate.pc, "opcode": "STOP"} |
|
|
|
|
|
|
|
return new_instruction |
|
|
|
|
|
|
|
|
|
|
|
@property |
|
|
|
@property |
|
|
|
def current_transaction( |
|
|
|
def current_transaction( |
|
|
|