From d9f4eac7957f8ac00949b551490c5bda55379b64 Mon Sep 17 00:00:00 2001 From: Joran Honig Date: Thu, 28 Mar 2019 13:41:47 +0100 Subject: [PATCH] implement basic plugin factory --- .../laser/ethereum/plugins/plugin_factory.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 mythril/laser/ethereum/plugins/plugin_factory.py diff --git a/mythril/laser/ethereum/plugins/plugin_factory.py b/mythril/laser/ethereum/plugins/plugin_factory.py new file mode 100644 index 00000000..e45b5db8 --- /dev/null +++ b/mythril/laser/ethereum/plugins/plugin_factory.py @@ -0,0 +1,18 @@ +from mythril.laser.ethereum.plugins.plugin import LaserPlugin +from mythril.laser.ethereum.plugins.implementations.benchmark import BenchmarkPlugin +from mythril.laser.ethereum.plugins.implementations.mutation_pruner import MutationPruner + + +class PluginFactory: + """ The plugin factory constructs the plugins provided with laser """ + + @staticmethod + def build_benchmark_plugin(name: str) -> LaserPlugin: + """ Creates an instance of the benchmark plugin with the given name """ + return BenchmarkPlugin(name) + + @staticmethod + def build_mutation_pruner_plugin() -> LaserPlugin: + """ Creates an instance of the mutation pruner plugin""" + return MutationPruner() +