Unused Import Detector
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
This tool detects unused import statements in smart contracts by analyzing verified source code and identifying references to imported symbols. It scans contract source code to find all import statements, then checks each imported symbol to determine if it is actually referenced anywhere in the contract—including function calls, type references, inheritance, and other usage patterns. Results are presented as a detailed import analysis report with status indicators (used/unused/unknown), reference lists, and actionable recommendations. This is essential for developers cleaning up technical debt, auditors identifying dead code, and teams optimizing contract size and readability.
HOW TO USE
Connect your wallet (read-only, no transaction required) and select the target network. Enter the contract name and address. Click "detect unused imports" and the tool will verify the contract, fetch its source code, and analyze all import statements for actual usage. Results display a summary with import statistics (used/unused/unknown counts), detailed import cards showing each import's status, reference count, and usage detail, and a table of all imports with their statuses. Use the report to identify and remove unused imports, reducing contract size and improving code clarity.
TECHNICAL MECHANISM
The detector uses ethers.js v5.7.2 to perform a multi-stage import analysis. First, it calls eth_getCode to verify the contract is deployed and uses block explorer APIs (Etherscan, Sourcify) to fetch verified source code. The tool parses the source code to extract import statements and the symbols they introduce (contract names, library names, function names, type names). It then analyzes the entire contract body to find references to these symbols, including function calls, type declarations, inheritance declarations, event references, and modifier usage. Each import is classified: "used" if at least one reference to a symbol from that import is found, "unused" if no references are found, or "unknown" if the analysis cannot determine usage (e.g., due to dynamic resolution or complex patterns). The tool also tracks which specific symbols are referenced from each import, providing detailed evidence of usage. Results are compiled into a structured report with detailed import information, usage evidence, and recommendations for removing unused imports.
WHAT IT CANNOT SEE
This tool cannot detect unused imports in contracts that are not verified or have opaque implementation details where source code is not available. It is limited by the availability and completeness of source code verification—if the source code is not fully verified or is obfuscated, the analysis may be incomplete. It cannot analyze imports that are dynamically resolved or used through reflection-like patterns (e.g., using strings to reference imported symbols). The analysis relies on the accuracy and completeness of source code parsing and reference analysis; syntax errors or non-standard patterns may produce inaccurate results. It cannot analyze contracts that are not deployed or have been self-destructed. The tool is limited to the specific contract instances and source code versions that are accessible via RPC and block explorer APIs. It cannot guarantee that detected unused imports reflect actual dead code without manual review—some imports may appear unused due to indirect references or external contract dependencies that are not captured in the source code.
PLEASE NOTE
This is a read‑only analytics tool—it never submits transactions or modifies contract state. It is designed for EVM‑compatible chains and works best with verified contracts that have clean, parsable source code. The import analysis report is for informational and code quality purposes only and should not be considered a comprehensive code review. Always manually review detected unused imports before removing them, as some imports may be necessary for external contract interactions or future functionality. The tool's classification is heuristic—imports marked as "unknown" may require manual inspection.