Skip to content
Back to search

safe-solana-builder

The first Claude skill for writing production-grade, security-first Solana programs. Anchor & Native Rust. Built by Frank Castle.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/frankcastleauditor--safe-solana-builder/badge.svg)](/listings/frankcastleauditor--safe-solana-builder)

HTML

<a href="/listings/frankcastleauditor--safe-solana-builder"><img src="/api/listings/frankcastleauditor--safe-solana-builder/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Claude Setup

1. Download `safe-solana-builder.skill` from the [Releases](../../releases) page 2. In Claude.ai, go to **Settings → Skills** 3. Upload the `.skill` file 4. The skill activates automatically whenever you ask Claude to write a Solana program

Cursor IDE Support

Cursor does not natively support `.skill` files, but the same system works by loading this repository as a **context rule** source.

1. Clone the repository into Cursor's skills directory:

mkdir -p ~/.cursor/skills
git clone https://github.com/Frankcastleauditor/safe-solana-builder.git ~/.cursor/skills/safe_solana_builder

2. Restart Cursor 3. Reference the skill in your prompt:

Use the safe_solana_builder skill.

Build a secure Solana program using Anchor.

Trigger Phrases

The skill fires on any of the following: - *"Write a Solana program that..."* - *"Build an Anchor program for..."* - *"Create a native Rust Solana contract..."* - *"Scaffold a Solana program..."* - *"Help me write a program that does X on Solana"*

---

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

SKILL.md · Manifest · 257 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. ---
  2. name: safe-solana-builder
  3. description: >
  4. Use this skill whenever the user wants to write, scaffold, or build a Solana smart contract
  5. or program from scratch. Triggers on: "write a Solana program", "create a smart contract",
  6. "build an anchor program", "write a native Rust Solana program", "scaffold a Solana program",
  7. "help me write a program that does X on Solana", or any request to produce production-grade
  8. on-chain Solana code. This skill enforces Frank Castle's security best practices and pitfall
  9. avoidance guidelines automatically — giving every program a first layer of protection before
  10. it ever reaches an auditor. Always use this skill — even for simple programs — whenever
  11. Solana program code is the primary deliverable.
  12. ---
  13. # Safe Solana Builder — by Frank Castle
  14. You are writing production-grade Solana programs. Security is not an afterthought — it is baked into every line. Every program produced by this skill ships with a full project scaffold, a test file skeleton, and a security checklist.
  15. ### What This Skill Enforces
  16. This skill systematically addresses the following vulnerability classes derived from real Solana protocol audits:
  17. - **Protocol-specific vulnerabilities** — oracle manipulation, fee bypass, slippage attacks, LP preprocessing gaps
  18. - **Logic flaws & edge cases** — dust DoS, time-unit mismatches, pre/post-fee inconsistencies, type narrowing
  19. - **Access control & authorization bugs** — missing signer checks, frontrunnable initialization, namespace capture, inbound transfer auth, post-expiry flows
  20. - **State management errors** — coupled-field resets, counter drift, vested/unvested balance separation, rollback safety
  21. - **Lifecycle & state machine integrity** — absorbing terminal states, canonical transition matrices, paired time-gate divergence, user-param reachability constraints
  22. - **PDA-related issues** — zombie accounts, seed collisions, canonical bump enforcement, lifecycle closure
  23. - **Reward accounting exploits** — rounding gaps in partial unstake, dual-path reward debt bypass, retroactive rate application, dead share price, inflation/first-depositor attack, fee-on-transfer delta errors, rewards sourced from principal
  24. - **Vault & pool architecture** — missing withdrawal paths on PDA-controlled vaults, spendable-vs-reserved balance confusion, backing invariant violations
  25. - **Slippage & fee ordering** — slippage on net (not gross) amount, fee base must match executed amount, unambiguous gross/fee/net naming
  26. - **AMM / bonding-curve safety** — completion-threshold capping, post-cap slippage recheck, terminal-state solvency, reserve layer alignment
  27. - **Config management** — every write-path validation, tri-state patch semantics, partial-update corruption, cross-field invariant enforcement, atomic commit
  28. - **Withdraw & drain safety** — cumulative caps for partial withdrawals, liability settlement before residual extraction, exact-remainder accounting after partial drains
  29. - **Token-2022 extension validation** — PermanentDelegate seizure, uncontrolled FreezeAuthority, TransferHook CPI forwarding, ConfidentialTransfer compatibility
  30. - **Treasury & fee recipient hygiene** — sweepable authority requirement, config-time ATA validation
  31. - **Admin key security** — two-step rotation pattern, timelock recommendations for Critical programs
  32. - **BPF runtime limits** — 4096-byte stack frame DoS, Box<> mitigation for large account types
  33. - **Panic safety** — no `unwrap()`/`expect()` on user-controlled `Option`/`Result` paths; always return typed errors
  34. - **Input validation & metadata hygiene** — non-empty required fields, explicit length bounds, URI scheme allowlists for user-supplied strings
  35. ---
  36. ## Step 1 — Ask the Framework Question
  37. If the user has not already specified, ask exactly this (and nothing else):
  38. > "Should I write this in **Native Rust**, **Anchor**, or **Pinocchio**?"
  39. **Pinocchio** is Anza's zero-dependency, zero-copy framework — 88–95% CU reduction vs. Anchor. Best for high-throughput programs (DEXs, orderbooks, vaults). It is unaudited — flag this in the checklist for Critical programs.
  40. Wait for the answer before proceeding.
  41. ---
  42. ## Step 1b — Ask the Testing Question
  43. Immediately after the framework is chosen, ask:
  44. > "Should I use **LiteSVM** for testing (fast, in-process, no validator required), or the default testing approach for your framework?"
  45. Present the options clearly:
  46. | Option | Best For |
  47. |---|---|
  48. | **LiteSVM** | Fast unit/integration tests, CI pipelines, time-lock testing, CU profiling, account injection from devnet |
  49. | **Framework default** | Anchor: TypeScript with `@coral-xyz/anchor`; Native: `solana-program-test` async harness |
  50. Wait for the answer before proceeding to Step 2.
  51. ---
  52. ## Step 2 — Load Your Reference Files
  53. Once **both** the framework and testing approach are chosen, read the following files
  54. **before writing a single line of code**:
  55. 1. **Always read first (both files):**
  56. - `references/shared-base.md` — Core security rules, pitfall patterns, and best practices for ALL Solana programs. Sections 1–20 cover foundational security; sections 21–31 cover vulnerability-derived rules from real protocol audits (reward accounting, vault architecture, Token-2022 extension validation, admin key rotation, BPF stack frame limits, lifecycle state machine integrity, slippage/fee ordering, bonding-curve AMM safety, initialization/namespace capture, config management, withdraw/drain safety, and treasury sweepability).
  57. 2. **Then read the framework-specific file:**
  58. - Native Rust → `references/native-rust.md`
  59. - Anchor → `references/anchor.md`
  60. - Pinocchio → `references/pinocchio.md`
  61. → Framework-specific patterns, constraints, additional pitfalls, and common build/tooling errors.
  62. 3. **If LiteSVM was chosen for testing, also read:**
  63. - `references/litesvm.md`
  64. → Test structure patterns, sysvar control, token setup, account inspection, CU profiling, and the LiteSVM security test checklist.
  65. 4. **Check for a relevant example:**
  66. See the Examples table at the bottom of this file. If a similar program exists in `examples/`, read it before writing — use it as a quality and structure benchmark.
  67. Do not skip or skim these files. They are the source of truth for this skill.
  68. ---
  69. ## Step 3 — Assess Risk Level
  70. Before gathering requirements, classify the program's sensitivity. This determines how thorough your security comments and "Known Limitations" section must be.
  71. | Level | Criteria | Examples |
  72. |---|---|---|
  73. | 🟢 Low | No SOL/token custody, no CPI, single user, read-heavy | Counter, registry, simple config |
  74. | 🟡 Medium | Token transfers, basic CPI, multi-user state, PDAs | Staking, voting, simple escrow |
  75. | 🔴 Critical | Vaults, multi-CPI chains, admin keys, large TVL potential | AMM, lending, NFT launchpad, bridges |
  76. State the risk level explicitly at the top of your security checklist. For 🔴 Critical programs: add a "High-Risk Decisions" section to the checklist and flag every admin key, upgrade authority, and irreversible state transition.
  77. ---
  78. ## Step 4 — Gather Program Requirements
  79. Collect the following in one message (if not already provided):
  80. - **Program name** — what is it called?
  81. - **What it does** — brief description of functionality
  82. - **Accounts** — what accounts does it need?
  83. - **Instructions** — what instructions/functions?
  84. - **Access control** — who can call what? Any admin roles?
  85. - **Token standard** — SPL Token, Token-2022, or none?
  86. - **Any external programs called** — Metaplex, another protocol, etc.?
  87. If the user's description already covers most of these, proceed and note your assumptions clearly.
  88. ---
  89. ## Step 5 — Write the Program
  90. ### 5a. Security Pre-Check (internal, not shown to user)
  91. Before writing, run through shared-base.md and the framework file. Flag which rules apply to this program's design. Note any inherent risks in the design itself.
  92. ### 5b. Project Scaffold
  93. Deliver a complete, ready-to-build project structure. Not just `lib.rs` — the full scaffold:
  94. **For Anchor:**
  95. ```
  96. <program-name>/
  97. ├── Anchor.toml
  98. ├── Cargo.toml
  99. ├── programs/
  100. │ └── <program-name>/
  101. │ ├── Cargo.toml
  102. │ └── src/
  103. │ └── lib.rs
  104. └── tests/
  105. └── <program-name>.ts # if framework-default testing
  106. └── <program-name>_tests.rs # if LiteSVM testing
  107. ```
  108. **For Native Rust / Pinocchio:**
  109. ```
  110. <program-name>/
  111. ├── Cargo.toml
  112. └── src/
  113. ├── lib.rs
  114. ├── instruction.rs
  115. ├── processor.rs
  116. ├── state.rs
  117. └── error.rs
  118. tests/
  119. └── <program-name>_tests.rs # if LiteSVM testing
  120. ```
  121. ### 5c. The Program Code
  122. Requirements:
  123. - Compilable without warnings
  124. - Every account validated — ownership, type, signer, writable as applicable
  125. - No unchecked math on any financial value
  126. - PDAs derived with canonical bumps stored and reused
  127. - No logic after CPI calls that relies on stale state
  128. - Descriptive program-specific error types
  129. - Inline security comments on every non-obvious decision
  130. Header comment block at the top of `lib.rs`:
  131. ```rust
  132. // ============================================================
  133. // Program: <ProgramName>
  134. // Framework: <Native Rust | Anchor | Pinocchio>
  135. // Testing: <LiteSVM | solana-program-test | TypeScript/Anchor>
  136. // Risk Level: 🟢 Low | 🟡 Medium | 🔴 Critical
  137. // Author: Frank Castle Security Template
  138. // Security: See accompanying security-checklist.md
  139. // ============================================================
  140. ```
  141. ### 5d. Test File
  142. Always produce a test file. The approach depends on what was chosen in Step 1b:
  143. #### If LiteSVM was chosen:
  144. Produce Rust tests following `references/litesvm.md`. The test file must include:
  145. **Required structure:**
  146. - A `setup()` function that loads the `.so`, airdrops SOL, and returns `(LiteSVM, Keypair)`
  147. - A `send_tx()` helper that wraps message/transaction building and calls `expire_blockhash()` after each send
  148. - PDA derivation helpers matching the on-chain seeds exactly
  149. **Happy path tests (implement fully):**
  150. - End-to-end success flow with full state assertion (lamports, token balances, account data fields)
  151. - Account closure verification (lamports=0, data.len()=0, owner=system_program)
  152. - CU consumption logged and recorded to a `CU_RESULTS` static for the `zz_cu_summary` test
  153. **Security/edge case tests (implement or scaffold with `TODO` + explanation comment):**
  154. - Wrong signer → `assert!(result.is_err())`
  155. - Re-initialization attempt → `assert!(result.is_err())`
  156. - Before-deadline action → `assert!(result.is_err())` (if time-locked)
  157. - After-deadline action → succeeds (time travel via `svm.set_sysvar(&clock)`)
  158. - Over-limit / zero-amount arithmetic → `assert!(result.is_err())`
  159. - Any program-specific edge cases flagged in the checklist
  160. **Mandatory closing test:**
  161. ```rust
  162. #[test]
  163. fn zz_cu_summary() { /* print CU table */ }
  164. ```
  165. #### If framework default was chosen:
  166. - Anchor: TypeScript using `@coral-xyz/anchor`
  167. - Native Rust: Rust integration tests using `solana-program-test`
  168. In both cases, cover the same happy path + security/edge case matrix as above.
  169. Mark unimplemented security tests with `TODO` and an explanation comment.
  170. ## Examples
  171. The `examples/` directory contains complete reference programs written to this skill's standard. Before writing, check if a similar example exists — use it to calibrate output quality, structure, and checklist depth. Do not copy-paste; treat it as a quality benchmark.
  172. | Example | Framework | Testing | Risk Level | What it demonstrates |
  173. |---|---|---|---|---|
  174. | `examples/nft-whitelist-mint/` | Anchor | TypeScript/Anchor | 🔴 Critical | MintConfig PDA, per-user WhitelistEntry PDA, double-mint guard, Metaplex CPI with program ID verification, SOL balance check around CPI, Token-2022 compatible mint, safe account close |
  175. Each example folder contains:
  176. - `lib.rs` — the full program
  177. - `security-checklist.md` — the applied rules checklist
  178. ---
  179. ## Notes for Edge Cases
  180. - **Simple programs (counter, hello world):** Still apply all checks. Simplicity is not an excuse for insecure patterns.
  181. - **Inherent design risks (admin key with no timelock, no upgrade authority check):** Flag explicitly in the checklist under "High-Risk Decisions" or "Known Limitations."
  182. - **Token-2022 features (transfer hooks, confidential transfers):** Flag in the checklist as requiring extra manual review — expanded attack surface. Always validate extensions at `initialize` per shared-base §23.
  183. - **Programs with `remaining_accounts`:** Apply the same ownership, signer, and type checks as named accounts. Flag in checklist.
  184. - **Upgrade authority:** Always note whether the program is upgradeable and who holds the authority. Recommend a timelock or multisig for 🔴 Critical programs.
  185. - **Staking / yield programs:** Pay special attention to shared-base §21 (reward accounting). Every reward payout path must update `reward_debt`. Retroactive rate application and partial-unstake rounding are the two most common Critical findings in this category.
  186. - **Share-based pools (stX/totalStaked):** Apply §21.4 (dead share price) and §21.5 (inflation attack) checks at design time — these are architectural, not line-level, and cannot be patched easily after deployment.
  187. - **Large account contexts:** After `anchor build`, check for stack frame warnings (§25). Apply `Box<>` to large account fields if the warning appears.
  188. - **AMM / bonding-curve programs:** Apply §26 (lifecycle state machine), §27 (slippage/fee), §28 (AMM safety), and §30 (withdraw/drain). Completion-threshold capping, post-cap slippage recheck, and terminal-state solvency are the top findings in this category.
  189. - **Programs with admin config instructions:** Apply §29 (initialization, namespace capture, user-param safety, config management). Every config write path must validate all fields; partial updates must use patch semantics to avoid silent zeroing.
  190. - **Programs with a fee treasury or protocol wallet:** Apply §31.4 — the treasury authority must be sweepable (valid signer path to move tokens out). Validate the ATA at config time, not at withdrawal time.
  191. - **User-supplied metadata (name, symbol, URI):** Apply §18 metadata hygiene — enforce non-empty, explicit length bounds, and URI scheme allowlists at the point of instruction processing.
  192. - **LiteSVM for RPC-dependent tests:** LiteSVM does not support all RPC methods. If the program requires wallet integration tests or real validator behaviour, note in the checklist that those tests must use `solana-test-validator` separately.
README.md · README · 240 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # 🛡️ Safe Solana Builder
  2. **The first Claude skill for writing production-grade, security-first Solana programs.**
  3. Built by a Solana security researcher, for Solana developers — so your code arrives at audit already hardened.
  4. ---
  5. ## What Is This?
  6. **Safe Solana Builder** is a security skill system you can load into AI coding workflows (Claude / Cursor) so Frank Castle's Solana security knowledge is applied before writing a single line of code.
  7. This is not a prompt. It is a layered reference architecture that forces Claude to:
  8. - Select the right framework (Anchor, Native Rust, or Pinocchio) and load the matching security ruleset
  9. - Choose a testing approach (LiteSVM or framework default) and load the matching test patterns
  10. - Assess the program's risk level (🟢 Low / 🟡 Medium / 🔴 Critical) before touching the keyboard
  11. - Apply a curated set of security rules drawn from real audit findings — CPIs, PDAs, account validation, arithmetic, Token-2022, and more
  12. - Deliver a full project scaffold — not just `lib.rs`
  13. - Generate a test file skeleton with security edge cases pre-identified
  14. - Output a security checklist documenting every rule applied and every known limitation
  15. Every program this skill produces has a first layer of protection baked in before it reaches an auditor.
  16. ---
  17. ## Why It Exists
  18. Most AI-generated Solana code is a liability.
  19. Missing ownership checks. Non-canonical bumps. Stale data used after CPIs. No duplicate account guards. No checked arithmetic. It compiles, it looks right, and it fails on mainnet.
  20. The Cyfrin team built a skill like this for Solidity. Nobody built one for Solana — until now.
  21. ---
  22. ## What It Produces
  23. For every program request, the skill outputs:
  24. | Output | Description |
  25. |---|---|
  26. | **Full project scaffold** | `Anchor.toml`, `Cargo.toml`, proper folder structure — ready to `anchor build` or `cargo build-sbf` |
  27. | **`lib.rs`** | Complete, compilable program with inline security comments |
  28. | **Test file** | LiteSVM or framework-default — happy path tests implemented + security edge case tests scaffolded with `TODO` bodies |
  29. | **`security-checklist.md`** | Every rule applied, every assumption made, every known limitation flagged |
  30. ---
  31. ## Skill Structure
  32. ```
  33. safe-solana-builder/
  34. ├── SKILL.md ← Orchestrator: workflow, risk assessment, output format
  35. ├── references/
  36. │ ├── shared-base.md ← Framework-agnostic rules (PDAs, CPIs, arithmetic, Token-2022...)
  37. │ ├── anchor.md ← Anchor-specific: constraints, account types, reload(), close...
  38. │ ├── native-rust.md ← Native Rust: manual validation sequence, invoke, deserialization...
  39. │ ├── pinocchio.md ← Pinocchio: zero-copy patterns, bytemuck, wincode, CPI, Shank IDL...
  40. │ └── litesvm.md ← LiteSVM: test setup, sysvar control, CU profiling, account injection...
  41. └── examples/
  42. └── nft-whitelist-mint/
  43. ├── lib.rs ← Full Anchor NFT whitelist mint program
  44. └── security-checklist.md ← 31-rule checklist for the example
  45. ```
  46. ### Reference Coverage
  47. The reference files cover:
  48. **Shared Base (framework-agnostic)**
  49. - Account & identity validation (signer, owner, discriminator, reinitialization)
  50. - PDA security (canonical bumps, sharing prevention, seed collision)
  51. - Arithmetic safety (checked math, multiply-before-divide, slippage)
  52. - Duplicate mutable account attacks
  53. - Full CPI safety surface (arbitrary CPI, stale reload, signer pass-through, SOL drain, post-CPI ownership)
  54. - Account lifecycle (rent, closing, anti-revival, sysvar verification)
  55. - Token-2022 compatibility
  56. - Transaction model safety
  57. - Safe Rust patterns
  58. **Anchor-specific**
  59. - Account type selection (`Account<T>` vs `UncheckedAccount` vs `Interface`)
  60. - Constraint patterns (`has_one`, `seeds+bump`, `init` vs `init_if_needed`, `close`, `realloc`)
  61. - `reload()` after CPI — non-negotiable
  62. - `token_interface::transfer_checked` for Token-2022 compatibility
  63. - CPI construction, signer seeds, program ID validation
  64. - `#[error_code]` custom errors
  65. **Native Rust-specific**
  66. - The 6-step mandatory validation sequence (key → owner → signer → writable → discriminator → data)
  67. - Borsh deserialization patterns and length pre-checks
  68. - PDA derivation: `find_program_address` at init, `create_program_address` on reuse
  69. - `invoke` vs `invoke_signed` patterns
  70. - Manual post-CPI data refresh
  71. - Account creation via System Program CPI
  72. - Manual 3-step safe account close
  73. - Custom error enum with `ProgramError` conversion
  74. **Pinocchio-specific** *(new)*
  75. - Zero-copy account definitions with `bytemuck` (`Pod` + `Zeroable`, explicit `_padding`, 8-byte alignment)
  76. - Account validation via `TryFrom` pattern and validation macros
  77. - `wincode` for instruction data serialization — `SchemaWrite`/`SchemaRead` derives, zero-copy deserialization for `#[repr(C)]` structs, `Pod<T>` foreign type adapter, compact-u16 / ShortVec length encoding
  78. - `bytemuck` vs `wincode` decision rule: bytemuck for on-chain account state, wincode for instruction data
  79. - CPI via `pinocchio-system` and `pinocchio-token` typed helpers
  80. - IDL generation with Shank + Codama
  81. - Entrypoint selection by CU cost (`no_allocator!`, `lazy_entrypoint!`, `entrypoint!`)
  82. - Pinocchio-specific build errors and toolchain notes
  83. **LiteSVM testing** *(new)*
  84. - In-process VM — no validator, no async runtime, fastest test loop available
  85. - `setup()` pattern, `send_tx()` helper with `expire_blockhash()`, `TransactionMetadata` fields
  86. - Devnet account injection via `svm.set_account()` + RPC client
  87. - Token setup with `litesvm-token` (`CreateMint`, `CreateAssociatedTokenAccount`, `MintTo`)
  88. - Full sysvar control: time travel (`Clock`), slot warping, rent reads
  89. - CU profiling with `CU_RESULTS` static and `zz_cu_summary` test
  90. - Simulation (dry-run without state commit)
  91. - Framework-specific patterns: Anchor (`InstructionData`/`ToAccountMetas`) and Native/Pinocchio (manual discriminator encoding)
  92. - 12-item LiteSVM security test checklist
  93. - Common errors table (GLIBC, `BlockhashNotFound`, missing SO, etc.)
  94. ---
  95. ## How to Install
  96. ### Claude Setup
  97. 1. Download `safe-solana-builder.skill` from the [Releases](../../releases) page
  98. 2. In Claude.ai, go to **Settings → Skills**
  99. 3. Upload the `.skill` file
  100. 4. The skill activates automatically whenever you ask Claude to write a Solana program
  101. ### Cursor IDE Support
  102. Cursor does not natively support `.skill` files, but the same system works by loading this repository as a **context rule** source.
  103. 1. Clone the repository into Cursor's skills directory:
  104. ```bash
  105. mkdir -p ~/.cursor/skills
  106. git clone https://github.com/Frankcastleauditor/safe-solana-builder.git ~/.cursor/skills/safe_solana_builder
  107. ```
  108. 2. Restart Cursor
  109. 3. Reference the skill in your prompt:
  110. ```txt
  111. Use the safe_solana_builder skill.
  112. Build a secure Solana program using Anchor.
  113. ```
  114. ### Trigger Phrases
  115. The skill fires on any of the following:
  116. - *"Write a Solana program that..."*
  117. - *"Build an Anchor program for..."*
  118. - *"Create a native Rust Solana contract..."*
  119. - *"Scaffold a Solana program..."*
  120. - *"Help me write a program that does X on Solana"*
  121. ---
  122. ## Roadmap
  123. This skill is under active development. Planned expansions:
  124. - [ ] Native Rust example program (staking vault)
  125. - [ ] Additional reference sources: SPL Token-2022 extension security, Metaplex deep-dive, oracle manipulation patterns
  126. - [ ] Anchor v0.31+ specific patterns
  127. - [ ] Invariant testing guidance (Trident, Fuzz)
  128. - [ ] Common DeFi pattern references: AMM, lending, bonding curves
  129. The reference files are the living core of this skill. Every new vulnerability source, audit finding, or best practice I encounter gets distilled and added. The skill grows with the threat landscape.
  130. ---
  131. ## About the Author
  132. ## Hi there 👋 I'm Frank Castle
  133. 🛡️ **Smart Contract Security Researcher** specializing in **Solana (Anchor)** and **Rust-based ecosystems**.
  134. I help protocols ship safer smart contracts by identifying **critical vulnerabilities**, validating everything related to DeFi and blockchain, and for Solana reviewing **CPI / PDA / token-account security boundaries / and any custom logic**.
  135. ---
  136. ### 🔍 Focus Areas
  137. - **Solana Program Security**: Anchor, PDAs, CPI, account validation, rent/DoS patterns
  138. - **SPL / Token-2022 Security**: extensions, mint assumptions, transfer hooks, authority models
  139. - **DeFi Security**: AMMs, vaults, staking, bonding curves, fee mechanisms
  140. - **Rust Security**: state machines, invariants, edge cases, unsafe patterns
  141. ---
  142. ### 🏆 Highlights
  143. - 70+ Rust audits, 50+ Solana audits
  144. - 250+ Critical/High severity vulnerabilities identified
  145. - Top placements in competitive audits:
  146. - 🥈 **2nd place** — HydraDX Omnipool (Code4rena)
  147. - 🏅 **4th place** — Centrifuge (Cantina)
  148. ---
  149. ### 📌 Featured Repositories
  150. - 🔒 **Public Audits**: [public-audits](https://github.com/Frankcastleauditor/public-audits)
  151. - 🧪 **Solana CTF / Practice**: [Solana_CTF](https://github.com/Frankcastleauditor/Solana_CTF)
  152. ---
  153. ### 🧾 Writeups & Content
  154. - X (Twitter): [@0xcastle_chain](https://x.com/0xcastle_chain)
  155. - Medium: [FrankCastleAudits](https://medium.com/@FrankCastleAudits)
  156. ---
  157. ### 📫 Contact
  158. - Twitter: [@castle_chain](https://x.com/0xcastle_chain)
  159. - Discord: [@castle_chain](https://discordapp.com/users/1119172287330004992)
  160. - Telegram: [castle_chain](https://t.me/castle_chain)
  161. - Email: castlechain99@gmail.com
  162. ---
  163. ⭐ If you're building on Solana and want a security review, feel free to reach out.
  164. ---
  165. ## License
  166. MIT — use it, fork it, build on it. If you add something valuable, consider contributing it back.
  167. ---
  168. *Safe Solana Builder — first layer of protection, before the auditor ever sees your code.*

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.