mythril.laser.plugin package
Subpackages
- mythril.laser.plugin.plugins package
- Subpackages
- Submodules
- mythril.laser.plugin.plugins.benchmark module
- mythril.laser.plugin.plugins.call_depth_limiter module
- mythril.laser.plugin.plugins.dependency_pruner module
- mythril.laser.plugin.plugins.instruction_profiler module
- mythril.laser.plugin.plugins.mutation_pruner module
- mythril.laser.plugin.plugins.plugin_annotations module
- Module contents
Submodules
mythril.laser.plugin.builder module
mythril.laser.plugin.interface module
- class mythril.laser.plugin.interface.LaserPlugin[source]
Bases:
object
Base class for laser plugins
Functionality in laser that the symbolic execution process does not need to depend on can be implemented in the form of a laser plugin.
Laser plugins implement the function initialize(symbolic_vm) which is called with the laser virtual machine when they are loaded. Regularly a plugin will introduce several hooks into laser in this function
Plugins can direct actions by raising Signals defined in mythril.laser.ethereum.plugins.signals For example, a pruning plugin might raise the PluginSkipWorldState signal.
mythril.laser.plugin.loader module
- class mythril.laser.plugin.loader.LaserPluginLoader(*args, **kwargs)[source]
Bases:
object
The LaserPluginLoader is used to abstract the logic relating to plugins. Components outside of laser thus don’t have to be aware of the interface that plugins provide
- instrument_virtual_machine(symbolic_vm: LaserEVM, with_plugins: List[str] | None)[source]
Load enabled plugins into the passed symbolic virtual machine :param symbolic_vm: The virtual machine to instrument the plugins with :param with_plugins: Override the globally enabled/disabled builders and load all plugins in the list
- is_enabled(plugin_name: str) bool [source]
Returns whether the plugin is loaded in the symbolic_vm
- Parameters:
plugin_name – Name of the plugin to check
- load(plugin_builder: PluginBuilder) None [source]
Enables a Laser Plugin
- Parameters:
plugin_builder – Builder that constructs the plugin
mythril.laser.plugin.signals module
- exception mythril.laser.plugin.signals.PluginSignal[source]
Bases:
Exception
Base plugin signal
These signals are used by the laser plugins to create intent for certain actions in the symbolic virtual machine
- exception mythril.laser.plugin.signals.PluginSkipState[source]
Bases:
PluginSignal
Plugin to skip world state
Plugins that raise this signal while the add_world_state hook is being executed will force laser to abandon that world state.
- exception mythril.laser.plugin.signals.PluginSkipWorldState[source]
Bases:
PluginSignal
Plugin to skip world state
Plugins that raise this signal while the add_world_state hook is being executed will force laser to abandon that world state.
Module contents
Laser plugins
This module contains everything to do with laser plugins
Laser plugins are a way of extending laser’s functionality without complicating the core business logic. Different features that have been implemented in the form of plugins are: - benchmarking - path pruning
Plugins also provide a way to implement optimisations outside of the mythril code base and to inject them. The api that laser currently provides is still unstable and will probably change to suit our needs as more plugins get developed.
For the implementation of plugins the following modules are of interest: - laser.plugins.plugin - laser.plugins.signals - laser.svm
Which show the basic interfaces with which plugins are able to interact