mythril.plugin package

Submodules

mythril.plugin.discovery module

class mythril.plugin.discovery.PluginDiscovery[source]

Bases: object

PluginDiscovery class

This plugin implements the logic to discover and build plugins in installed python packages

build_plugin(plugin_name: str, plugin_args: Dict[KT, VT]) → mythril.plugin.interface.MythrilPlugin[source]

Returns the plugin for the given plugin_name if it is installed

get_plugins(default_enabled=None) → List[str][source]

Gets a list of installed mythril plugins

Parameters:default_enabled – Select plugins that are enabled by default
Returns:List of plugin names
init_installed_plugins()[source]
installed_plugins
is_installed(plugin_name: str) → bool[source]

Returns whether there is python package with a plugin with plugin_name

mythril.plugin.interface module

class mythril.plugin.interface.MythrilCLIPlugin(**kwargs)[source]

Bases: mythril.plugin.interface.MythrilPlugin

MythrilCLIPlugin interface

This interface should be implemented by mythril plugins that aim to add commands to the mythril cli

class mythril.plugin.interface.MythrilLaserPlugin(**kwargs)[source]

Bases: mythril.plugin.interface.MythrilPlugin, mythril.laser.plugin.builder.PluginBuilder, abc.ABC

Mythril Laser Plugin interface

Plugins of this type are used to instrument the laser EVM

class mythril.plugin.interface.MythrilPlugin(**kwargs)[source]

Bases: object

MythrilPlugin interface

Mythril Plugins can be used to extend Mythril in different ways: 1. Extend Laser, in which case the LaserPlugin interface must also be extended 2. Extend Laser with a new search strategy in which case the SearchStrategy needs to be implemented 3. Add an analysis module, in this case the AnalysisModule interface needs to be implemented 4. Add new commands to the Mythril cli, using the MythrilCLIPlugin Interface

author = 'Default Author'
name = 'Plugin Name'
plugin_description = 'This is an example plugin description'
plugin_license = 'All rights reserved.'
plugin_type = 'Mythril Plugin'
plugin_version = '0.0.1 '

mythril.plugin.loader module

class mythril.plugin.loader.MythrilPluginLoader[source]

Bases: object

MythrilPluginLoader singleton

This object permits loading MythrilPlugin’s

load(plugin: mythril.plugin.interface.MythrilPlugin)[source]

Loads the passed plugin

This function handles input validation and dispatches loading to type specific loaders. Supported plugin types:

  • laser plugins
  • detection modules
set_args(plugin_name: str, **kwargs)[source]
exception mythril.plugin.loader.UnsupportedPluginType[source]

Bases: Exception

Raised when a plugin with an unsupported type is loaded

Module contents