A simple VSCode extension that allows you to fetch and view smart contract source code directly from blockchain explorers. Perfect for developers, auditors, and anyone working with smart contracts.
✨ Features
🔍 Multi-Chain Support: Fetch contracts from 8 major blockchains
📄 Smart Parsing: Handles both single-file and multi-file Solidity contracts
🎨 Syntax Highlighting: Full Solidity syntax highlighting with VSCode's built-in support
⚡ Fast & Reliable: Quick fetching with proper error handling
✅ Input Validation: Validates chain IDs and contract addresses
🔄 Real-time Progress: Progress indicators for all operations
🚀 Quick Start
Install the extension from VSCode Marketplace
Open Command Palette (Cmd+Shift+P on Mac, Ctrl+Shift+P on Windows/Linux)
Search for "Fetch Contract Source Code"
Select blockchain from the dropdown
Enter contract address (0x...)
View source code in a new VSCode window
🌐 Supported Networks
Network
Chain ID
Example Contract
Ethereum
1
0xA0b86a33E6a5a5d7a2f...
BSC
56
0xD89C46F8ee42d3078E6...
Polygon
137
0x8f3Cf7ad23Cd3CaDbD9...
Arbitrum
42161
0x912CE59144191C1204E...
Optimism
10
0x4200000000000000000...
Base
8453
0x833589fCD6eDb6E08f4...
Avalanche
43114
0xB31f66AA3C1e785363F...
Fantom
250
0x21be370D5312f44cB42...
Development Setup
# Clone repository
git clone https://github.com/junaire/contract-source-viewer.git
cd contract-source-viewer
# Install dependencies
npm install
# Compile
npm run compile
# Run in development mode
# Press F5 in VSCode to launch Extension Development Host
🤝 Contributing
We welcome contributions!
Fork the repository
Create your feature branch (git checkout -b feature/amazing-feature)
Commit your changes (git commit -m 'Add some amazing feature')
Push to the branch (git push origin feature/amazing-feature)
Open a Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.