Expand description
Utility functions and helpers for the EDB engine.
This module provides a collection of utility functions and helper modules that support various aspects of the EDB debugging engine. These utilities handle common tasks across contract analysis, compilation, source code processing, and external service integration.
§Core Utility Modules
§Contract and Artifact Management
- [
artifact] - Contract artifact handling and metadata management - [
compilation] - Solidity compilation utilities and configuration - [
abi] - ABI processing and type conversion utilities
§Source Code Processing
- [
source] - Source code analysis and manipulation utilities - [
ast_prune] - AST pruning and optimization for instrumentation
§Bytecode Analysis
disasm- EVM bytecode disassembly and analysis utilities
§External Service Integration
- [
etherscan] - Etherscan API integration and data fetching utilities
§Design Philosophy
The utilities in this module are designed to be:
- Reusable: Common functionality shared across multiple engine components
- Efficient: Optimized for performance in debugging scenarios
- Reliable: Robust error handling and edge case management
- Modular: Independent modules that can be used separately
Each utility module focuses on a specific domain while providing clean interfaces for integration with the broader EDB engine ecosystem.
Re-exports§
pub use disasm::*;
Modules§
- disasm
- EVM bytecode disassembly utilities
Macros§
- etherscan_
rate_ limit_ guard - Automaticall pause the request if the rate limit is reached and resume it after the rate limit is reset.
Structs§
- ASTPruner
- We prune the AST to remove or refine nodes that are not strongly related to analysis. We do this because the Solidity compiler has changed the AST structure over time, but we want to maintain a consistently parsable AST structure for debugging purposes.
- Artifact
- Compiled contract artifact with comprehensive metadata and compilation data.
- Onchain
Compiler - Onchain compiler.
Functions§
- abi_
encode_ available - Check if the abi.encode function (which is available since solidity 0.4.24) is available in the given version requirement.
- compile_
contract_ source_ to_ source_ unit - Compile a string as Solidity source code to a SourceUnit
- contains_
function_ type - Check recursively if the type name contains a function type.
- contains_
mapping_ type - Check recursively if the type name contains a mapping type.
- contains_
user_ defined_ type - Check recursively if the type name contains a user defined type or a function type.
- encode_
function_ call - Encode a text-form function call to bytes using the provided function ABI
- find_
index_ of_ first_ statement_ in_ block - Find the index of the first statement in the
Block. - find_
index_ of_ first_ statement_ in_ block_ or_ statement - Find the index of the first statement in the
BlockOrStatement. - find_
next_ index_ of_ block_ or_ statement - Find the index of the next character immediately after the
BlockOrStatement. - find_
next_ index_ of_ last_ statement_ in_ block - Find the index of the next character immediately after the last statement in the
Block. - find_
next_ index_ of_ source_ location - Find the index of the next character immediately after the source location.
- find_
next_ index_ of_ statement - Find the index of the next character immediately after the
Statement. - find_
next_ semicolon_ after_ source_ location - Find the next semicolon after the source location.
- get_
compilation_ input_ from_ metadata - Prepare the input for solc using metadate downloaded from Etherscan.
- mutability_
to_ str - Convert the mutability to a string.
- next_
etherscan_ api_ key - Returns the next Etherscan API key to use from the rotation pool.
- slice_
source_ location - Slice the source location.
- source_
string_ at_ location - Get the source string at the given location.
- source_
string_ at_ location_ unchecked - Get the source string at the given location.
- visibility_
to_ str - Convert the visibility to a string.