Refactored code

cli-code-coverage
e-ngo 5 years ago
parent 2eb9d9f6c5
commit e0b0bec825
  1. 3
      mythril/analysis/symbolic.py
  2. 8
      mythril/laser/ethereum/svm.py

@ -103,6 +103,8 @@ class SymExecWrapper:
hex(ATTACKER_ADDRESS): attacker_account,
}
instruction_laser_plugin = PluginFactory.build_instruction_coverage_plugin()
self.laser = svm.LaserEVM(
dynamic_loader=dynloader,
max_depth=max_depth,
@ -113,6 +115,7 @@ class SymExecWrapper:
requires_statespace=requires_statespace,
enable_iprof=enable_iprof,
enable_coverage_strategy=enable_coverage_strategy,
instruction_laser_plugin=instruction_laser_plugin,
)
if loop_bound is not None:

@ -56,6 +56,7 @@ class LaserEVM:
requires_statespace=True,
enable_iprof=False,
enable_coverage_strategy=False,
instruction_laser_plugin=None,
) -> None:
"""
Initializes the laser evm object
@ -104,16 +105,11 @@ class LaserEVM:
self.iprof = InstructionProfiler() if enable_iprof else None
if enable_coverage_strategy:
from mythril.laser.ethereum.plugins.implementations.coverage.coverage_plugin import (
InstructionCoveragePlugin,
)
from mythril.laser.ethereum.plugins.implementations.coverage.coverage_strategy import (
CoverageStrategy,
)
instruction = InstructionCoveragePlugin()
instruction.initialize(self)
self.strategy = CoverageStrategy(self.strategy, instruction)
self.strategy = CoverageStrategy(self.strategy, instruction_laser_plugin)
log.info("LASER EVM initialized with dynamic loader: " + str(dynamic_loader))

Loading…
Cancel
Save