mythril.analysis package¶
Subpackages¶
- mythril.analysis.module package
- Subpackages
- mythril.analysis.module.modules package
- Submodules
- mythril.analysis.module.modules.arbitrary_jump module
- mythril.analysis.module.modules.arbitrary_write module
- mythril.analysis.module.modules.delegatecall module
- mythril.analysis.module.modules.dependence_on_origin module
- mythril.analysis.module.modules.dependence_on_predictable_vars module
- mythril.analysis.module.modules.ether_thief module
- mythril.analysis.module.modules.exceptions module
- mythril.analysis.module.modules.external_calls module
- mythril.analysis.module.modules.integer module
- mythril.analysis.module.modules.multiple_sends module
- mythril.analysis.module.modules.state_change_external_calls module
- mythril.analysis.module.modules.suicide module
- mythril.analysis.module.modules.unchecked_retval module
- mythril.analysis.module.modules.user_assertions module
- Module contents
- mythril.analysis.module.modules package
- Submodules
- mythril.analysis.module.base module
- mythril.analysis.module.loader module
- mythril.analysis.module.module_helpers module
- mythril.analysis.module.util module
- Module contents
- Subpackages
Submodules¶
mythril.analysis.analysis_args module¶
mythril.analysis.call_helpers module¶
This module provides helper functions for the analysis modules to deal with call functionality.
mythril.analysis.callgraph module¶
This module contains the configuration and functions to create call graphs.
mythril.analysis.issue_annotation module¶
-
class
mythril.analysis.issue_annotation.
IssueAnnotation
(conditions: List[mythril.laser.smt.bool.Bool], issue: mythril.analysis.report.Issue, detector)[source]¶ Bases:
mythril.laser.ethereum.state.annotation.StateAnnotation
-
persist_over_calls
¶ If this function returns true then laser will propagate the annotation between calls
The default is set to False
-
mythril.analysis.ops module¶
This module contains various helper methods for dealing with EVM operations.
-
class
mythril.analysis.ops.
Call
(node, state, state_index, _type, to, gas, value=<mythril.analysis.ops.Variable object>, data=None)[source]¶ Bases:
mythril.analysis.ops.Op
The representation of a CALL operation.
-
class
mythril.analysis.ops.
Op
(node, state, state_index)[source]¶ Bases:
object
The base type for operations referencing current node and state.
-
class
mythril.analysis.ops.
VarType
[source]¶ Bases:
enum.Enum
An enum denoting whether a value is symbolic or concrete.
-
CONCRETE
= 2¶
-
SYMBOLIC
= 1¶
-
mythril.analysis.potential_issues module¶
-
class
mythril.analysis.potential_issues.
PotentialIssue
(contract, function_name, address, swc_id, title, bytecode, detector, severity=None, description_head='', description_tail='', constraints=None)[source]¶ Bases:
object
Representation of a potential issue
-
class
mythril.analysis.potential_issues.
PotentialIssuesAnnotation
[source]¶ Bases:
mythril.laser.ethereum.state.annotation.StateAnnotation
-
search_importance
¶ Used in estimating the priority of a state annotated with the corresponding annotation. Default is 1
-
-
mythril.analysis.potential_issues.
check_potential_issues
(state: mythril.laser.ethereum.state.global_state.GlobalState) → None[source]¶ Called at the end of a transaction, checks potential issues, and adds valid issues to the detector.
Parameters: state – The final global state of a transaction Returns:
-
mythril.analysis.potential_issues.
get_potential_issues_annotation
(state: mythril.laser.ethereum.state.global_state.GlobalState) → mythril.analysis.potential_issues.PotentialIssuesAnnotation[source]¶ Returns the potential issues annotation of the given global state, and creates one if one does not already exist.
Parameters: state – The global state Returns:
mythril.analysis.report module¶
This module provides classes that make up an issue report.
-
class
mythril.analysis.report.
Issue
(contract: str, function_name: str, address: int, swc_id: str, title: str, bytecode: str, gas_used=(None, None), severity=None, description_head='', description_tail='', transaction_sequence=None, source_location=None)[source]¶ Bases:
object
Representation of an issue and its location.
-
static
add_block_data
(transaction_sequence: Dict[KT, VT])[source]¶ Adds sane block data to a transaction_sequence
-
as_dict
¶ Returns:
-
transaction_sequence_jsonv2
¶ Returns the transaction sequence as a json string with pre-generated block data
-
transaction_sequence_users
¶ Returns the transaction sequence without pre-generated block data
-
static
mythril.analysis.security module¶
This module contains functionality for hooking in detection modules and executing them.
-
mythril.analysis.security.
fire_lasers
(statespace, white_list: Optional[List[str]] = None) → List[mythril.analysis.report.Issue][source]¶ Fire lasers at analysed statespace object
Parameters: - statespace – Symbolic statespace to analyze
- white_list – Optionally whitelist modules to use for the analysis
Returns: Discovered issues
mythril.analysis.solver module¶
This module contains analysis module helpers to solve path constraints.
-
mythril.analysis.solver.
get_transaction_sequence
(global_state: mythril.laser.ethereum.state.global_state.GlobalState, constraints: mythril.laser.ethereum.state.constraints.Constraints) → Dict[str, Any][source]¶ Generate concrete transaction sequence. Note: This function only considers the constraints in constraint argument, which in some cases is expected to differ from global_state’s constraints
Parameters: - global_state – GlobalState to generate transaction sequence for
- constraints – list of constraints used to generate transaction sequence
mythril.analysis.swc_data module¶
This module maps SWC IDs to their registry equivalents.
mythril.analysis.symbolic module¶
This module contains a wrapper around LASER for extended analysis purposes.
-
class
mythril.analysis.symbolic.
SymExecWrapper
(contract, address: Union[int, str, mythril.laser.smt.bitvec.BitVec], strategy: str, dynloader=None, max_depth: int = 22, execution_timeout: Optional[int] = None, loop_bound: int = 3, create_timeout: Optional[int] = None, transaction_count: int = 2, modules: Optional[List[str]] = None, compulsory_statespace: bool = True, disable_dependency_pruning: bool = False, run_analysis_modules: bool = True, custom_modules_directory: str = '')[source]¶ Bases:
object
Wrapper class for the LASER Symbolic virtual machine.
Symbolically executes the code and does a bit of pre-analysis for convenience.
-
execution_info
¶
-
mythril.analysis.traceexplore module¶
This module provides a function to convert a state space into a set of state nodes and transition edges.