Cross-Contract Call Depth Explainer
Free to download on every platform. Comes pre-installed on BotFone, BotPad and BotFlip — with extra free apps included.
About this app
WHAT IT DOES
Cross-Contract Call Depth Explainer is a read-only tool that analyzes transaction call depth across multiple contracts, generating AI-powered plain-language explanations of call depth risks. It reads call trace tree, call depth, external call targets, function signatures, gas limits at each depth, reentrancy indicators, execution context, call stack patterns, event logs, transaction history, contract bytecode, access controls, failure handling patterns, and state modifications at each depth. The tool then presents this data alongside an AI-generated analysis of the cross-contract call depth, explaining the call tree, identifying potential risks at each depth (gas exhaustion, reentrancy, call failures), and recommending mitigation strategies — helping you understand the complexity and risks of multi-contract transactions before executing or relying on them.
HOW TO USE
Connect your wallet using the BGWallet bridge and select your target network. Enter the transaction hash you want to analyze. Optionally enter the starting contract address for focused analysis. Click "Analyze call depth" to read on-chain transaction traces. The tool displays the transaction hash, maximum call depth, call count, gas exhaustion risk level (Low/Medium/High), and call depth risk level (Low/Medium/High). Detailed information includes call tree, function signatures, gas limits per depth, reentrancy indicators, execution context, call stack patterns, failure handling, and state modifications. A mitigation strategy box provides specific recommendations. An AI explanation appears below the on-chain data, analyzing the cross-contract call depth of the transaction, explaining the call tree, identifying potential risks at each depth, and recommending mitigation strategies such as reducing call depth, using reentrancy guards, and ensuring sufficient gas before you execute or rely on the transaction. The wallet's own signature step still protects you — this explanation is informational only and does not replace reviewing what you approve in your wallet.
TECHNICAL MECHANISM
The tool uses ethers.js v5.7.2 with the provider from the BGWallet bridge to read on-chain transaction traces. No hardcoded contract addresses are used — you are always in control of which contract you trust. When analyzing call depth, the tool reads the call trace tree by tracing the transaction execution, reads the call depth by tracking the nesting level of external calls, reads external call targets from the trace, reads function signatures from the trace data, reads gas limits at each depth from the trace, detects reentrancy indicators by analyzing call patterns, reads execution context from the trace, reads call stack patterns by analyzing the sequence of calls, reads event logs by scanning for call-related events, reads transaction history via provider.getTransaction(txHash), reads contract bytecode via provider.getCode(target), reads access controls from the bytecode, reads failure handling patterns from the trace, and reads state modifications at each depth by analyzing storage changes. The tool fetches event logs by walking backwards in chunks and halving chunk size on failure, ensuring logs are properly read despite varying RPC limitations. The data is formatted and passed to the AI bridge via BGAI.generate() with a structured prompt that includes all the on-chain data read. The AI is instructed to analyze the cross-contract call depth of the transaction, explain the call tree, identify potential risks at each depth, and recommend mitigation strategies — while stating plainly that it cannot detect call depth risks that involve off-chain contract behavior or social engineering, cannot guarantee that a call tree will remain stable across different conditions, and cannot detect hidden calls through delegatecall or inline assembly that are not reflected in the call trace. The AI response is capped at 1,024 tokens to ensure concise, focused call depth assessments. All computed values are guarded against negative numbers — if a call depth or gas limit appears invalid, the tool flags it rather than displaying nonsensical values.
WHAT IT CANNOT SEE
This tool cannot detect call depth risks that involve off-chain contract behavior or social engineering. It cannot guarantee that a call tree will remain stable across different conditions. It cannot detect hidden calls through delegatecall or inline assembly that are not reflected in the call trace. It cannot predict gas exhaustion at specific depths under varying conditions. The AI explanation is generated from on-chain data only and cannot detect off-chain contract behavior, hidden call patterns, or social engineering attacks. It cannot predict whether a transaction will encounter gas exhaustion at a specific depth under different conditions. The tool does not continuously monitor call depth; each analysis is a snapshot at the time of the lookup. It cannot detect delayed calls, hidden delegatecalls, or off-chain factors. The tool does not store any data persistently; all state is in-memory and resets on reload. The AI explanation is informational and does not constitute financial advice, legal advice, or a guarantee of transaction safety or protection against call depth vulnerabilities.
PLEASE NOTE
Cross-Contract Call Depth Explainer works exclusively with EVM-compatible chains. It requires a Web3 wallet (MetaMask or similar) and the BGWallet bridge. Explanations are AI-generated from data the app reads on-chain — always review what you are actually signing in your wallet before approving it. Deep cross-contract calls carry significant risk including gas exhaustion, reentrancy, and call failures. Use this tool as a guide only; always cross-check with independent sources and contract audits for critical decisions. This is experimental software; use at your own risk.