Import Path Resolver for Contract Libraries
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
Import Path Resolver for Contract Libraries is a developer-focused tool that resolves Solidity import statements to their underlying npm packages or local file paths. It parses the source code to extract all import directives, then analyzes each import to determine its type: npm package (scoped or unscoped) or local file. The tool maps scoped packages (@scope/package) and unscoped packages to their node_modules paths, and local imports (./, ../) to project-relative paths. It optionally accepts a package.json manifest to extract version information, and a project root path to resolve local imports. The output shows each import with its original path, resolved path, package name (if applicable), resolution type (npm/local), and status indicator. This enables developers to understand the dependency structure of their contracts and identify issues with import resolution before compilation.
HOW TO USE
Paste your Solidity source code into the "Solidity source code" text area. Optionally, paste a package.json manifest to provide version context for npm packages. Optionally, provide a project root path to resolve local imports (e.g., "/path/to/project"). Click "Resolve imports" to analyze the source. The tool will display a summary including total imports, resolved count, unknown count, local imports, and npm imports. A detailed list shows each import with its original path, resolved path, package name, resolution type, and status.
TECHNICAL NOTE: IMPORT PARSING AND RESOLUTION STRATEGY
The tool uses regex-based parsing to extract import directives from Solium source code, matching both single and double-quoted import paths. It classifies imports into three categories: npm packages (paths not starting with '.'), scoped npm packages (paths starting with '@'), and local imports (paths starting with '.'). For npm packages, the tool extracts the package name (handling both scoped and unscoped formats) and resolves to a node_modules path. When a package.json is provided, the tool extracts version information for each package. For local imports, the tool prepends the project root path to resolve to an absolute path. The tool also checks imported packages against a known list of common Solidity and Web3 packages to mark known packages.
WHAT IT CANNOT SEE
The tool cannot automatically resolve imports without source code or a package manifest. It cannot resolve imports that use absolute paths or non-standard resolvers (e.g., custom build tool aliases). The tool is limited to the accuracy of the provided package structure. It cannot resolve imports for non-npm dependencies such as Git submodules or local symlinks. The tool cannot verify that resolved paths actually exist on the filesystem. It cannot handle projects with custom build configurations (e.g., Hardhat paths, Truffle aliases). The tool cannot resolve imports for non-EVM chains.
PLEASE NOTE
This tool is designed exclusively for Solidity source code on EVM-compatible chains. The resolution is based on npm package naming conventions and standard node_modules structure. Actual path resolution depends on the project's build configuration and filesystem structure. The tool provides no warranty that resolved paths match the actual deployment structure; users are responsible for verifying paths in their project context.