Works with the AI Agents you already use
Solana Testing Fuzzing
by BanditXBT
LiteSVM/Mollusk/Trident testing for Solana: wrong-account attack matrix, invariants, mutation checks.
Free
About this skill
Security tests on Solana are mostly negative tests with wrong accounts. Test what an attacker can pass, not just the happy path.
- LiteSVM / Mollusk: in-process SVM, no validator, very fast; load program
.so, set account state directly, advance clock/slots. Best for unit-level and property tests; Mollusk (Anza-maintained, Rust-only) is aimed at single-instruction testing with CU benchmarking, requires every account to be declared explicitly, andmollusk-svm-programs-tokensupplies the Token, Token-2022, and ATA programs for token tests. LiteSVM supports multi-language tests. - Bankrun /
solana-program-test: in-process bank with time warping and account injection (JS or Rust). anchor test: spins upsolana-test-validator; slower; good for integration and client flows.- Trident (fuzzing framework for Anchor): stateful, instruction-sequence fuzzing with invariant checks.
solana-test-validator --clone <ACCOUNT> --url <rpc>(and--clone-upgradeable-program): bring real mainnet accounts (oracles, pools, mints) into a local test; pin the slot/time by snapshotting once and committing fixtures.
-
Happy path + state assertions: after each instruction, assert the full state delta (balances, counters, authorities), not just "no error".
-
Negative/adversarial account tests (mandatory per instruction):
- wrong signer / missing signer
- wrong owner program on state, oracle, token accounts
- wrong account type with same layout (cosplay)
- substituted PDA (wrong seeds/bump), non-canonical bump
- duplicate accounts passed in two slots
- fake program in place of token/system/own program (CPI target)
- mismatched mint/authority on token accounts
- uninitialized, already-initialized, and closed accounts
- spoofed sysvar accounts
remaining_accountswith malicious entries Each must fail with the expected error code (assert the specific error, not just failure).
-
Boundary & arithmetic: zero, 1, max
u64, decimals mix, rounding-direction checks, overflow behavior with release flags (cargo build-sbfuses release: test the built.so, not just debug unit tests). -
Time & slot: warp clock for funding, vesting, staleness windows; test at exact boundaries.
-
Property/stateful fuzz: generate random instruction sequences over a small actor set (users, keepers, admin) with random amounts and price moves; assert invariants after each step: conservation of tokens (Σ vault = Σ user claims + fees), no negative equity paths, authority never changes unexpectedly, health monotonic under non-risk actions, no instruction succeeds that should fail by spec.
-
Differential tests: compare on-chain fixed-point math with a Python/
mpmathreference over dense grids and extremes. -
Compute regression: record CU per instruction at worst-case sizes and fail CI on >X% increase.
-
Write invariants and the attacker-account matrix before code review ends; each suspected finding becomes a failing test.
-
Run happy + negative suites on every commit (seconds with LiteSVM).
-
Nightly: fuzz with fixed seeds recorded; persist crashing sequences as regression tests.
-
Mutation check: break the program deliberately (remove a
has_one, flip a comparison, remove a signer check); the suite must go red. Unkilled mutants are missing tests. -
Test with Token-2022 mints and transfer-fee/hook extensions if you accept arbitrary mints (see
spl-token-2022-security). -
Test upgrade paths: old-layout account + new program version (migration/versioning).
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 13 days ago
- Free with an Agensi account
- Software
- Rust
- Optional
- AnchorLiteSVMorMollusk
Permissions
No special permissions declared or detected
What's inside
Frequently Asked Questions
New in Security
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Security.