mythril.laser.plugin.plugins.coverage package

Submodules

mythril.laser.plugin.plugins.coverage.coverage_plugin module

class mythril.laser.plugin.plugins.coverage.coverage_plugin.CoveragePluginBuilder[source]

Bases: mythril.laser.plugin.builder.PluginBuilder

name = 'coverage'
class mythril.laser.plugin.plugins.coverage.coverage_plugin.InstructionCoveragePlugin[source]

Bases: mythril.laser.plugin.interface.LaserPlugin

This plugin measures the instruction coverage of mythril. The instruction coverage is the ratio between the instructions that have been executed and the total amount of instructions.

Note that with lazy constraint solving enabled that this metric will be “unsound” as reachability will not be considered for the calculation of instruction coverage.

initialize(symbolic_vm: mythril.laser.ethereum.svm.LaserEVM)[source]

Initializes the instruction coverage plugin

Introduces hooks for each instruction :param symbolic_vm: :return:

is_instruction_covered(bytecode, index)[source]

mythril.laser.plugin.plugins.coverage.coverage_strategy module

class mythril.laser.plugin.plugins.coverage.coverage_strategy.CoverageStrategy(super_strategy: mythril.laser.ethereum.strategy.BasicSearchStrategy, instruction_coverage_plugin: mythril.laser.plugin.plugins.coverage.coverage_plugin.InstructionCoveragePlugin)[source]

Bases: mythril.laser.ethereum.strategy.BasicSearchStrategy

Implements a instruction coverage based search strategy

This strategy is quite simple and effective, it prioritizes the execution of instructions that have previously been uncovered. Once there is no such global state left in the work list, it will resort to using the super_strategy.

This strategy is intended to be used “on top of” another one

get_strategic_global_state() → mythril.laser.ethereum.state.global_state.GlobalState[source]

Returns the first uncovered global state in the work list if it exists, otherwise super_strategy.get_strategic_global_state() is returned.

Module contents