You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mike MacCana led the Quicknode fork of the [Solana Foundation program examples](https://github.com/solana-developers/program-examples) from late 2025. The first commits on this repository lineage are dated **8 April 2026**; the summary below covers that work through the initial merge.
10
10
11
11
### What changed (high level)
12
12
13
13
**Toolchain and frameworks.** The tree had accumulated examples from several years of Solana development (including Anchor releases going back to the ~0.26 era in 2022 and many intermediate versions). The fork brought the Anchor examples up to **Anchor 1.0.0** stable (from 1.0.0-rc.5), refreshed Agave/Solana CLI pins, standardized on **pnpm**, and added parallel implementations in **[Quasar](https://quasar-lang.com/docs)**, **Pinocchio**, **Native Rust**, and **ASM** where applicable. Token-2022 examples were renamed to **`token-extensions`**.
14
14
15
-
**Testing.** Replaced the old pattern of local validators, Bankrun, and scattered TypeScript `anchor test` flows with **LiteSVM in-process tests** for most Anchor programs — matching current Anchor defaults (`cargo test` wired through `Anchor.toml` / `pnpm test`). Fixed broken or flaky tests across Native, Pinocchio, and Anchor; added missing harnesses (e.g. block-list Pinocchio). CI was reworked for a repo this size: path filtering, caching, matrix sharding, and reliable detection of framework roots.
15
+
**Testing.** Replaced the old pattern of local validators, Bankrun, and scattered TypeScript `anchor test` flows with **LiteSVM in-process tests** for most Anchor programs - matching current Anchor defaults (`cargo test` wired through `Anchor.toml` / `pnpm test`). Fixed broken or flaky tests across Native, Pinocchio, and Anchor; added missing harnesses (e.g. block-list Pinocchio). CI was reworked for a repo this size: path filtering, caching, matrix sharding, and reliable detection of framework roots.
16
16
17
17
**Programs and layout.** Broke large monolithic `lib.rs` files into **instruction handler modules**; adopted **`InitSpace`** and explicit PDA bumps instead of magic account sizes; corrected several logic bugs (escrow, token swap invariant, counter authority checks, compression Bubblegum program id, and more). Expanded finance and token-extension coverage; reorganized transfer-hook examples (including block-list under Pinocchio).
18
18
19
19
**Documentation.** Rewrote the root README (framework badges, clearer example blurbs, ASM links), ran a style and **truth audit** on READMEs, and linked canonical [Solana terminology](https://solana.com/docs/references/terminology) on first mention. Added this changelog, `CONTRIBUTING.md` (aligned with LiteSVM testing), README templates, per-example Anchor and Quasar READMEs, fixed Husky for GUI git clients, removed unused maintainer scripts (`sync-package-json`, `cicd.sh`, local-validator helpers for the allow/block-list UI), dropped the orphan `tokens/spl-token-minter/` tree, and removed legacy root `package.json` dependencies (web3.js, Bankrun, chai).
20
20
21
-
**Removed / deferred.** Dropped duplicate or WIP trees (duplicate block-list Pinocchio copy, Quasar metadata example blocked on `sol_realloc`, root `yarn.lock`). Some examples remain excluded from CI via `.ghaignore` until they build cleanly again (compression, escrow, pyth, and others — see that file for the live list).
21
+
**Removed / deferred.** Dropped duplicate or WIP trees (duplicate block-list Pinocchio copy, Quasar metadata example blocked on `sol_realloc`, root `yarn.lock`). Some examples remain excluded from CI via `.ghaignore` until they build cleanly again (compression, escrow, pyth, and others - see that file for the live list).
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+11-15Lines changed: 11 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,28 +20,24 @@ Thank you for considering a contribution to this repository. We welcome new exam
20
20
21
21
## Testing
22
22
23
-
This repo uses an in-process test runtime — no local validator boot, no `solana-test-validator`, no `anchor test --validator legacy`.
23
+
This repo uses an in-process test runtime - no local validator boot, no `solana-test-validator`, no `anchor test --validator legacy`.
24
24
25
-
For Anchor and Quasar examples, tests are written in TypeScript and run with `node:test` via `tsx`:
26
-
27
-
```bash
28
-
npx tsx --test --test-reporter=spec tests/*.ts
29
-
```
30
-
31
-
The conventional `Anchor.toml``[scripts]` entry is:
25
+
**Anchor examples** are tested in Rust with [LiteSVM](https://www.anchor-lang.com/docs/testing/litesvm). Tests live in `programs/<name>/tests/`, load the compiled program with `include_bytes!("../../../target/deploy/<name>.so")`, and run with `cargo test` (build the `.so` first with `cargo build-sbf` or `anchor build`). The conventional `Anchor.toml``[scripts]` entry is:
32
26
33
27
```toml
34
28
[scripts]
35
-
test = "npx create-codama-clients; npx tsx --test --test-reporter=spec tests/*.ts"
29
+
test = "cargo test"
36
30
```
37
31
38
-
The TypeScript tests use:
32
+
Optional helpers come from the [`solana-kite`](https://crates.io/crates/solana-kite) crate (wallet creation, token mint helpers, `send_transaction_from_instructions`).
33
+
34
+
**Quasar examples** are tested in Rust with QuasarSVM. Run `quasar build` (which also generates the Rust client crate under `target/client/rust/` that the tests import), then `quasar test` or `cargo test`.
35
+
36
+
**Native and Pinocchio examples** use `litesvm` directly from Rust, except for a few that keep TypeScript tests (`tsx --test` with [`solana-kite`](https://solanakite.org) and [`@solana/kit`](https://solanakit.com)) where the example is specifically about client-side tooling.
39
37
40
-
-[`solana-kite`](https://solanakite.org) for the connection, wallet creation, token mint helpers, PDA derivation, and `sendTransactionFromInstructions`.
41
-
-[`@solana/kit`](https://solanakit.com) for the core types (`KeyPairSigner`, `Address`, `lamports`).
42
-
- A [Codama](https://github.com/codama-idl/codama)-generated client (via `npx create-codama-clients`) for invoking the program instructions. Do **not** use `anchor.workspace` or `program.methods.X().rpc()`.
38
+
Do not write TypeScript tests for Anchor or Quasar programs, and do not use `anchor.workspace` or `program.methods.X().rpc()`.
43
39
44
-
Native and Pinocchio examples may use `litesvm` directly from Rust where appropriate.
40
+
Tests must exercise the program for real: initialize accounts, send transactions through the program's instruction handlers, and assert resulting state and balances. Placeholder tests (`assert!(true)`, build-only checks) don't count.
45
41
46
42
## Style
47
43
@@ -54,7 +50,7 @@ Other conventions:
54
50
- Use full words rather than abbreviations (`transaction`, not `tx` or `txn`; `account`, not `acc`).
55
51
- Prefer `async`/`await` over `.then()`/`.catch()`.
56
52
- Use `Array<T>` rather than `T[]` in TypeScript.
57
-
- Avoid magic numbers — name or explain them.
53
+
- Avoid magic numbers - name or explain them.
58
54
- Write "onchain" / "offchain" as single words (no hyphen).
Copy file name to clipboardExpand all lines: README.md
+25-17Lines changed: 25 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,11 +6,11 @@
6
6
7
7
Each example is available in one or more of the following frameworks:
8
8
9
-
-[⚓ Anchor](https://www.anchor-lang.com/)— the most popular framework for Solana development. Build with `anchor build`, test with `pnpm test` as defined in `Anchor.toml`.
10
-
-[💫 Quasar](https://quasar-lang.com/docs)— a newer, more performant framework with Anchor-compatible ergonomics. Run `pnpm test` to execute tests.
11
-
-[🤥 Pinocchio](https://github.com/anza-xyz/pinocchio)— a zero-copy, zero-allocation library for Solana programs. Run `pnpm test` to execute tests.
12
-
-[🦀 Native Rust](https://docs.anza.xyz/)— vanilla Rust using Solana's native crates. Run `pnpm test` to execute tests.
13
-
-[🧬 ASM](https://github.com/blueshift-gg/sbpf)— hand-written sBPF assembly built with the `sbpf` toolchain. Run `pnpm build-and-test` to build and test.
9
+
-[⚓ Anchor](https://www.anchor-lang.com/)- the most popular framework for Solana development. Build with `anchor build`, test with `pnpm test` as defined in `Anchor.toml`.
10
+
-[💫 Quasar](https://quasar-lang.com/docs)- a newer, more performant framework with Anchor-compatible ergonomics. Run `pnpm test` to execute tests.
11
+
-[🤥 Pinocchio](https://github.com/anza-xyz/pinocchio)- a zero-copy, zero-allocation library for Solana programs. Run `pnpm test` to execute tests.
12
+
-[🦀 Native Rust](https://docs.anza.xyz/)- vanilla Rust using Solana's native crates. Run `pnpm test` to execute tests.
13
+
-[🧬 ASM](https://github.com/blueshift-gg/sbpf)- hand-written sBPF assembly built with the `sbpf` toolchain. Run `pnpm build-and-test` to build and test.
14
14
15
15
> [!NOTE]
16
16
> You don't need to write your own program for basic tasks like creating [accounts](https://solana.com/docs/terminology#account), transferring SOL, or minting tokens. These are handled by existing programs like the System Program and Token Program.
@@ -19,7 +19,7 @@ Each example is available in one or more of the following frameworks:
19
19
20
20
### Escrow
21
21
22
-
**Start here — the best first finance program to learn on Solana.** A neutral account that holds funds until both sides deliver, like a real-estate escrow or a lawyer's trust account. The maker deposits token A and names how much token B they want; when a taker supplies token B, the program swaps both in a single all-or-nothing transaction. This swap is the core idea behind every onchain exchange.
22
+
**Start here - the best first finance program to learn on Solana.** A neutral account that holds funds until both sides deliver, like a real-estate escrow or a lawyer's trust account. The maker deposits token A and names how much token B they want; when a taker supplies token B, the program swaps both in a single all-or-nothing transaction. This swap is the core idea behind every onchain exchange.
@@ -49,7 +49,7 @@ A managed investment fund onchain, like an ETF or mutual fund. Investors deposit
49
49
50
50
### Betting Market
51
51
52
-
Parimutuel (pooled) prediction market — an admin opens an event with multiple outcomes, bettors stake tokens on an outcome, and at settlement the losing pool (minus a protocol fee) is split among winners in proportion to their stake.
52
+
Parimutuel (pooled) prediction market - an admin opens an event with multiple outcomes, bettors stake tokens on an outcome, and at settlement the losing pool (minus a protocol fee) is split among winners in proportion to their stake.
53
53
54
54
[⚓ Anchor](./tokens/betting-market/anchor)
55
55
@@ -70,7 +70,7 @@ Store and retrieve data using Solana accounts.
70
70
71
71
### Counter
72
72
73
-
Use a [PDA](https://solana.com/docs/terminology#program-derived-address-pda) to store global state — a counter that increments when called.
73
+
Use a [PDA](https://solana.com/docs/terminology#program-derived-address-pda) to store global state - a counter that increments when called.
@@ -148,7 +148,7 @@ Send SOL between two accounts.
148
148
149
149
### Pyth Price Feeds
150
150
151
-
An **oracle** brings real-world market prices — a dollar, a stock, a token —[onchain](https://solana.com/docs/terminology#onchain), like a Bloomberg terminal feeding live quotes. [Pyth](https://pyth.network/) publishes low-latency prices from institutional sources, each in its own price feed account. This example reads a feed and logs its price, confidence interval, and exponent — the building block an AMM, lending market, or vault uses to value assets.
151
+
An **oracle** brings real-world market prices - a dollar, a stock, a token -[onchain](https://solana.com/docs/terminology#onchain), like a Bloomberg terminal feeding live quotes. [Pyth](https://pyth.network/) publishes low-latency prices from institutional sources, each in its own price feed account. This example reads a feed and logs its price, confidence interval, and exponent - the building block an AMM, lending market, or vault uses to value assets.
Generate an IDL from a native Rust program with [Shank](https://github.com/metaplex-foundation/shank), then generate a TypeScript client from that IDL with [Codama](https://github.com/codama-idl/codama).
352
+
353
+
[🦀 Native](./tools/shank-and-codama/native)
354
+
347
355
---
348
356
349
357
**PRs welcome!** Follow the [contributing guidelines](./CONTRIBUTING.md) and see [CHANGELOG.md](./CHANGELOG.md) for release history.
0 commit comments