A Visual Studio Code extension for Solana development that provides security scanning and code coverage visualization for Solana programs.
Enhance your Solana development workflow with built-in security scanning. The extension automatically detects common security issues in your Solana programs:
- Immutable Account Mutated: Identifies when code attempts to modify an account marked as immutable
- Instruction Attribute Invalid: Detects invalid instruction attributes that could cause runtime errors
- Instruction Attribute Unused: Finds unused instruction attributes that might indicate logic errors
- Manual Lamports Zeroing: Detects unsafe manual lamports zeroing patterns
- Missing Check Comment: Identifies critical code sections lacking security check comments
- Missing InitSpace: Catches account creation without proper space initialization
- Missing Signer: Alerts when code fails to verify required signers
- Sysvar Account: Detects improper sysvar account access methods
- Unsafe Math: Identifies mathematical operations that could lead to overflows
Visualize your test coverage directly in the editor:
- See which lines are covered by your Trident tests
- View execution counts for each line
- Quickly identify untested code paths
- Customize the appearance of coverage indicators
solana: Scan Workspace for Security Issues(Ctrl+Alt+S / Cmd+Alt+S)solana: Reload Security Detectors(Ctrl+Alt+R / Cmd+Alt+R)solana: Show Code Coveragesolana: Close Code Coveragesolana: Show Security Scan Output
- Visual Studio Code 1.96.0 or newer
- Rust and Cargo (latest stable) for Solana program security scanning
- Trident tests in your workspace for code coverage features
- Install the extension from the Visual Studio Code Marketplace
- Open a Solana project in VS Code
- Use the command palette (Ctrl+Shift+P / Cmd+Shift+P) to run:
solana: Scan Workspace for Security Issuesto scan for security vulnerabilitiessolana: Show Code Coverageto visualize code coverage from Trident tests
server.path: Path to the Solana language server binary (leave empty to use bundled version)tridentCoverage.showExecutionCount: Show execution count numbers next to covered statementstridentCoverage.executionCountColor: Color of the execution count displaytridentCoverage.coverageServerPort: Port for the coverage server
