External Call Risk 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
External Call Risk Explainer is a read-only tool that analyzes external calls in smart contracts, generating AI-powered plain-language explanations of risks including reentrancy, gas griefing, call failures, and malicious targets. It reads contract bytecode, external call opcode usage, call target addresses, function signatures, gas limits, reentrancy patterns, access controls on external calls, call history, event logs, transaction history, contract state at call time, privileged function signatures, call return values, and failure handling patterns. The tool then presents this data alongside an AI-generated analysis of external call risks, explaining what external calls are made, who can trigger them, and what the impact would be, and recommending mitigation strategies — helping you understand the trustworthiness of a contract before interacting with or relying on it.
HOW TO USE
Connect your wallet using the BGWallet bridge and select your target network. Enter the contract address you want to analyze. Optionally enter a specific external call target address for focused analysis. Click "Analyze external call risk" to read on-chain contract data. The tool displays the contract address, call target, call count, reentrancy risk level (Low/Medium/High), and external call risk level (Low/Medium/High). Detailed information includes function signatures, gas limits, access control, failure handling, call history, contract state at call time, privileged functions, and return value handling. A mitigation strategy box provides specific recommendations. An AI explanation appears below the on-chain data, analyzing the contract's external calls for risks including reentrancy, gas griefing, call failures, and malicious targets, explaining what external calls are made, who can trigger them, and what the impact would be, and recommending mitigation strategies such as checks-effects-interactions, reentrancy guards, and safe call patterns before you interact with or rely on the contract. 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 contract data. No hardcoded contract addresses are used — you are always in control of which contract you trust. When analyzing external call risks, the tool reads the contract bytecode via provider.getCode(contract), scans for external call opcodes (CALL, STATICCALL, DELEGATECALL, CALLCODE), reads call target addresses from the bytecode or call data, reads function signatures by analyzing the call data, reads gas limits from the call instructions, detects reentrancy patterns by analyzing call sequences and state modifications, reads access controls on external calls by analyzing function modifiers, reads call history by scanning event logs and transaction history, reads transaction history via provider.getTransactionCount(contract), reads contract state at call time by analyzing storage access patterns, reads privileged function signatures by analyzing function selectors, reads call return values by analyzing the bytecode, and reads failure handling patterns by analyzing how return values are processed. 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 contract's external calls for risks including reentrancy, gas griefing, call failures, and malicious targets, explain what external calls are made, who can trigger them, and what the impact would be, and recommend mitigation strategies — while stating plainly that it cannot detect external call risks that involve off-chain contract behavior or social engineering, cannot guarantee that an external call will succeed or return expected data, and cannot detect reentrancy vulnerabilities in contracts that use non-standard patterns or inline assembly. The AI response is capped at 1,024 tokens to ensure concise, focused external call risk assessments. All computed values are guarded against negative numbers — if a gas limit or call count appears invalid, the tool flags it rather than displaying nonsensical values.
WHAT IT CANNOT SEE
This tool cannot detect external call risks that involve off-chain contract behavior or social engineering. It cannot guarantee that an external call will succeed or return expected data. It cannot detect reentrancy vulnerabilities in contracts that use non-standard patterns or inline assembly. It cannot detect malicious intent in external call targets beyond bytecode analysis. The AI explanation is generated from on-chain data only and cannot detect off-chain contract behavior, hidden call targets, or social engineering attacks. It cannot predict whether an external call will fail or be exploited. The tool does not continuously monitor external call risks; each analysis is a snapshot at the time of the lookup. It cannot detect delayed attacks, hidden call targets, 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 contract safety or protection against external call vulnerabilities.
PLEASE NOTE
External Call Risk 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. External calls carry significant risk including reentrancy, gas griefing, call failures, and malicious targets. 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.