🛡️ Solana Fender
Solana static analysis tool built in rust for anchor programs. Can be used as a rust crate for unit testing or as a CLI tool.
CLI Tool
⚙️ Installation
Install via Cargo ( Recommended )
Install via Source
Usage
Tip: Clone sealevel-attacks as a test case to sample this program.
Cargo
Source
Unit Testing Crate Usage
You can also use Solana Fender as a development dependency in your Anchor projects to run security checks as part of your unit tests.
Add as a Dev Dependency
Add Solana Fender to your program's Cargo.toml:
[]
= "0.4.3" # Replace with the latest version
Example Usage in Tests
Check /examples for more examples.
This allows you to integrate security checks directly into your test suite, ensuring that your program remains secure as you develop it.
Comparison of Solana Static Analysis Tools
It is highly encouraged to use as many tools as possible to ensure the security of your program.
Below is a comparison of various static analysis tools available for Solana smart contracts written in Rust/Anchor:
| Feature | Fender | l3x | X-Ray | radar |
|---|---|---|---|---|
| Languages | Rust | Rust | C++ | Python |
| Unit testing | ✅ | ❌ | ❌ | ❌ |
| Open Source | ✅ | ✅ | Demo | ✅ |
| Distribution | Cargo | Source | Docker | Docker |
| License | GPL-3.0 | ❌ | AGPL-3.0 | GPL-3.0 |
Security Checks
| Security Check | Fender | l3x | X-Ray | radar |
|---|---|---|---|---|
| Missing Owner Check | ✅ | ✅ | ✅ | ✅ |
| Account Data Matching | ✅ | ✅ | ✅ | ✅ |
| Account Initialization | ✅ | ✅ | ✅ | ✅ |
| Arbitrary CPI | ✅ | ✅ | ❓ | ✅ |
| Closing Accounts | ✅ | ✅ | ❓ | 🚧 |
| Duplicate Mutable Accounts | ✅ | ✅ | ❓ | ✅ |
| Missing Bump Seed Canonicalization | ✅ | ✅ | ✅ | ✅ |
| PDA Sharing | ✅ | ✅ | ✅ | ✅ |
| Type Cosplay | ✅ | ✅ | ✅ | ✅ |
| Invalid Sysvar Accounts | ✅ | ✅ | ❓ | ✅ |
| Reentrancy | ✅ | ❓ | ❓ | ❓ |
| Unauthorized Access | ✅ | ✅ | ❓ | ❓ |
| Integer Overflow | ✅ | ✅ | ✅ | ❓ |
❓- Could not find documentation if supported.🚧- Did not pass all sealevel-attacks
If there is any inaccuracy or updating needed, pull request or issue and we will try to update the table.