SmartExecutor Modules

Subpackages

Submodules

fdg.fdg_pruner module

class fdg.fdg_pruner.FDG_pruner(instructionCoveragePlugin: InstructionCoveragePlugin)[source]

Bases: LaserPlugin

get_depth_k_functions()[source]
get_runtime_bytecode(state: WorldState, contract_address)[source]
initialize(symbolic_vm: LaserEVM) None[source]

Initializes the FDG_pruner :param symbolic_vm

class fdg.fdg_pruner.FDG_prunerBuilder[source]

Bases: PluginBuilder

name = 'fdg-pruner'

fdg.fwrg_manager module

class fdg.fwrg_manager.AcyclicPath(start_functions: list, dk_functions: list, fwrg: FWRG)[source]

Bases: object

organize_paths()[source]
class fdg.fwrg_manager.FWRG(ftn_reads_in_condition: dict, ftn_writes: dict)[source]

Bases: object

get_reads_in_conditions(ftn_name: str)[source]
class fdg.fwrg_manager.FWRG_manager(start_functions: list, dk_functions: list, preprocess: Preprocessing)[source]

Bases: object

generate_graph_all_reads(writes: dict, all_reads: dict)[source]
get_children_all_reads(ftn: str)[source]
get_children_bf_update(ftn: str) list[source]
get_children_fwrg(ftn: str)[source]
get_children_fwrg_T_A(ftn: str) list[source]
get_parents_frwg(ftn: str) list[source]
class fdg.fwrg_manager.UpdateFWRG(fdg: FWRG, paths: AcyclicPath)[source]

Bases: object

add_edge_to_graph(from_: str, to_: str)[source]
add_edges_1()[source]

for each deep function, add edges to connect some of its paths

for each deep function, try to find a combined path :return:

construct_fwrg_targets()[source]
identity_dk_function_not_reachable()[source]
print_graphs(data: dict, file_name: str)[source]
fdg.fwrg_manager.test_1()[source]
fdg.fwrg_manager.test_2()[source]

fdg.function_coverage module

class fdg.function_coverage.FunctionCoverage(coveragePlugin: InstructionCoveragePlugin)[source]

Bases: object

compute_contract_coverage(runtime_bytecode: str)[source]
compute_coverage()[source]
compute_deep_functions()[source]

get a deep functions based the code coverage of each functions

Returns:

feed_function_intruction_indices(function_instruction_indices: dict)[source]
get_contract_coverage()[source]
get_coverage_for_a_function(ftn_name: str)[source]
get_deep_functions() list[source]
Returns:

a list of numbers indicating deep functions

get_deep_functions_1st_time()[source]
print_coverage()[source]
print_not_covered_instructions(ftn_name: str, instruction_list: list)[source]
set_runtime_bytecode(runtime_bytecode: str)[source]

fdg.instruction_modification module

class fdg.instruction_modification.InstructionModification(ftn_identifier: dict)[source]

Bases: object

change the function dispatcher at the beginning part of the instruction list

feed_instructions(state: WorldState, contract_address)[source]

new way to group instructions. :argument

modify_no_modification(state: WorldState)[source]
modify_on_a_state__str(state: WorldState, functions: list)[source]

update the instructions on multiple states

modity_on_multiple_states(states: [<class 'mythril.laser.ethereum.state.world_state.WorldState'>], functions: list)[source]

fdg.global_config module

Important parameters

Module contents