Refactor code

pull/1831/head
Nikhil Parasaram 10 months ago
parent b8ad3a9603
commit 28ffae0003
  1. 5
      mythril/laser/ethereum/svm.py
  2. 2
      mythril/support/opcodes.py

@ -592,11 +592,6 @@ class LaserEVM:
self._new_node_state( self._new_node_state(
state, JumpType.CONDITIONAL, state.world_state.constraints[-1] state, JumpType.CONDITIONAL, state.world_state.constraints[-1]
) )
elif opcode in ("SLOAD", "SSTORE") and len(new_states) > 1:
for state in new_states:
self._new_node_state(
state, JumpType.CONDITIONAL, state.world_state.constraints[-1]
)
elif opcode == "RETURN": elif opcode == "RETURN":
for state in new_states: for state in new_states:
self._new_node_state(state, JumpType.RETURN) self._new_node_state(state, JumpType.RETURN)

@ -96,7 +96,7 @@ OPCODES: Dict = {
"MSTORE8": {GAS: (3, 98), STACK: (2, 0), ADDRESS: 0x53}, "MSTORE8": {GAS: (3, 98), STACK: (2, 0), ADDRESS: 0x53},
# assume 64 byte r/w cost as upper bound # assume 64 byte r/w cost as upper bound
"SLOAD": {GAS: (800, 800), STACK: UN_OPERATOR_TUPLE, ADDRESS: 0x54}, "SLOAD": {GAS: (800, 800), STACK: UN_OPERATOR_TUPLE, ADDRESS: 0x54},
"SSTORE": {GAS: (5000, 25000), STACK: (1, 0), ADDRESS: 0x55}, "SSTORE": {GAS: (5000, 25000), STACK: (2, 0), ADDRESS: 0x55},
"JUMP": {GAS: (8, 8), STACK: (1, 0), ADDRESS: 0x56}, "JUMP": {GAS: (8, 8), STACK: (1, 0), ADDRESS: 0x56},
"JUMPI": {GAS: (10, 10), STACK: (2, 0), ADDRESS: 0x57}, "JUMPI": {GAS: (10, 10), STACK: (2, 0), ADDRESS: 0x57},
"PC": {GAS: (2, 2), STACK: Z_OPERATOR_TUPLE, ADDRESS: 0x58}, "PC": {GAS: (2, 2), STACK: Z_OPERATOR_TUPLE, ADDRESS: 0x58},

Loading…
Cancel
Save