// the find
solana-foundation/program-examples
A repository of Solana program examples
The official Solana Foundation example repo covering onchain program development across three frameworks: Anchor, native Rust, and Pinocchio. It is squarely aimed at developers learning to write Solana programs, with examples ranging from hello-world through PDAs, token extensions, compressed NFTs, oracles, and an AMM. Each example ships in all three framework variants wherever coverage exists.
Coverage of Token-2022 extensions is unusually thorough — transfer hooks, CPI guard, permanent delegate, interest-bearing tokens, and metadata pointer are all here with working implementations, not just stubs. The three-way framework parity (Anchor / native / Pinocchio) for most examples is genuinely useful: you can read the same concept implemented at different abstraction levels side by side, which is a better learning tool than any tutorial. CI runs scheduled against all three frameworks and uses litesvm for fast local testing, so examples are much less likely to silently rot than in typical example repos. The Pinocchio world-cup bracket game is a real, non-trivial program with a TypeScript client and webapp — it demonstrates the full stack, not just isolated snippets.
Coverage parity is incomplete in ways that will frustrate learners: CPI, repository-layout, and several token examples have no Pinocchio variant at all, while the AMM and fundraiser examples are Anchor-only with no native path. The README is a flat list with minimal explanation — each entry gets one sentence, so you have to open the code to understand what problem the example actually solves or what you're supposed to learn from it. Error handling in the native examples is barebones; most programs return `ProgramError::InvalidArgument` without teaching how to define and map custom errors, which is one of the first things a real program needs. No examples touch account versioning or upgradeable programs, which are the sharp edges where Solana bites production developers hardest.