This documentation provides complete guidance for verifying your smart contracts using our web interface, API endpoints, Hardhat, and Foundry.
0. How It Works
Somnia Explorer operates a comprehensive API server that includes all stable Solidity compiler versions (excluding nightly builds). Our verification system supports multiple methods to accommodate different development workflows:
- Single File Verification: For simple contracts contained in one source file
- Multi-Part File Verification: For complex contracts with multiple dependencies
- Standard JSON Input: The recommended method with complete compilation metadata
- API Verification: Submit verification requests programmatically through REST endpoints
- Hardhat Verification: Verify contracts directly from your Hardhat environment using the Somnia Explorer API
- Foundry Verification: Verify contracts from the command line with Foundry’s forge verify-contractcommand
Verification Process
- Input Processing: We receive your contract information through web interface or API
- Compilation: Our system compiles your source code using the specified compiler version
- Response Generation: Verification results are returned with contract details
💡 Recommendation: We strongly recommend using Standard JSON Input as it provides the most comprehensive information about your code, including optimizer settings and complete compilation metadata.
1. Explorer UI
The Somnia Explorer web interface provides an intuitive way to verify your smart contracts. The verification process is designed to be user-friendly while maintaining technical accuracy.