Pre-Audit Preparation

Pre-Audit Hardening Checklist

Prepare your Solana program for audit with this comprehensive checklist.

Overall Progress

0%

0 of 24 items completed

Testing

0%

Invariants

0%

Code Quality

0%

Security

0%

Documentation

0%

Deployment

0%

Testing

0/4

80%+ Branch Coverage

critical

Go beyond line coverage. Ensure all logical branches (if/else, match) in your instruction handlers are executed in tests.

📚 cargo-llvm-cov

Guided Instruction Fuzzing

critical

Use Trident's Manually Guided Fuzzing (MGF) to test sequences of instructions, ensuring the program state remains valid through complex transaction flows.

📚 Trident MGF Guide📚 Aki Blockchain Blog

Integration Tests

critical

Test interactions between multiple programs and accounts. Verify cross-program invocations (CPI) work correctly.

📚 Bankrun📚 Solana Program Library Tests

Negative Test Cases

high

Test that unauthorized actions fail gracefully. Verify all access control mechanisms reject invalid requests.

Invariants

0/6

Explicit Mathematical Invariants

critical

Define and test properties like: 'Pool Assets + Pending Rewards = Total Vault Balance' under all conditions.

Account-State Invariants

high

Ensure that 'locked' accounts cannot be closed and that 'authority' fields can never be set to the Zero Address.

Conservation & Ownership Invariants

critical

Explicitly verify that total token supply matches account sums and that account ownership cannot be altered by unauthorized instructions.

Verify Mathematical Properties

critical

Ensure calculations are overflow-safe, division handles zero correctly, and rounding doesn't accumulate errors.

State Transition Validation

high

Verify all state transitions are valid. Document allowed transitions and ensure code enforces them.

Reentrancy Protection

critical

Ensure no reentrancy vulnerabilities exist. Use checks-effects-interactions pattern where applicable.

Code Quality

0/4

Remove Dead Code

medium

Delete unused functions, commented-out code, and obsolete imports. Keep codebase clean and minimal.

Meaningful Variable Names

medium

Use descriptive names for variables, functions, and accounts. Avoid single letters except for loops.

Comprehensive Comments

high

Document complex logic, explain WHY (not just what), and add NatSpec-style comments to all public functions.

Error Messages

high

Provide clear, specific error messages. Each error should indicate what failed and why.

Security

0/5

Re-entrancy & CPI Limits

high

While Solana has runtime re-entrancy protection, verify that your program handles 'same-account-multiple-pass' logic correctly.

Access Control Checks

critical

Verify all privileged operations check proper authority. Use Anchor's has_one and constraint macros.

📚 Anchor Security Best Practices

Account Validation

critical

Validate all account inputs: check ownership, verify PDAs, ensure accounts are initialized correctly.

Integer Overflow Protection

critical

Use checked arithmetic everywhere. Never allow unchecked additions, multiplications, or subtractions.

📚 Rust Checked Math

Signer Verification

critical

Always verify signers before executing privileged operations. Check is_signer flag on accounts.

Documentation

0/3

README with Setup Instructions

high

Provide clear build and deployment instructions. Include all dependencies and environment setup.

Architecture Documentation

high

Document program architecture, account structures, and instruction flow. Include diagrams if complex.

Known Issues List

medium

Document any known limitations, assumptions, or areas of concern. Transparency helps auditors focus.

Deployment

0/2

Deployment Scripts

medium

Provide automated deployment scripts. Include initialization sequences and migration procedures.

Upgrade Mechanism

high

If using upgradeable programs, document upgrade authority and procedures. Plan for emergency upgrades.

Ready for Audit?

Once you've completed this checklist, you're ready to apply for the Solana Audit Subsidy Program!