Skip to content

Commit 34b9660

Browse files
authored
Merge pull request #26 from mikemaccana-edwardbot/chore/docs-truth-audit-2026-05-14
docs: truth audit across READMEs
2 parents 586902b + 2c44580 commit 34b9660

51 files changed

Lines changed: 438 additions & 899 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/.ghaignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ tools/shank-and-solita/native
99
tokens/pda-mint-authority/native
1010
tokens/nft-minter/native
1111
tokens/transfer-tokens/native
12-
tokens/spl-token-minter/native
12+
tokens/token-minter/native
1313
tokens/create-token/native
1414

1515
tokens/token-swap/anchor
@@ -68,6 +68,6 @@ basics/transfer-sol/steel
6868
tokens/escrow/steel
6969

7070
tokens/pda-mint-authority/steel
71-
tokens/spl-token-minter/steel
71+
tokens/token-minter/steel
7272
tokens/token-swap/steel
7373
tokens/transfer-tokens/steel

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,11 @@ Create an NFT collection, mint NFTs, and verify NFTs as part of a collection usi
153153

154154
[⚓ Anchor](./tokens/nft-operations/anchor) [💫 Quasar](./tokens/nft-operations/quasar)
155155

156-
### SPL Token Minter
156+
### Token Minter
157157

158-
Mint tokens from inside your own program using the Token program.
158+
Mint tokens from inside your own program using the Classic Token Program.
159159

160-
[⚓ Anchor](./tokens/spl-token-minter/anchor) [💫 Quasar](./tokens/spl-token-minter/quasar) [🦀 Native](./tokens/spl-token-minter/native)
160+
[⚓ Anchor](./tokens/token-minter/anchor) [💫 Quasar](./tokens/token-minter/quasar) [🦀 Native](./tokens/token-minter/native)
161161

162162
### Transfer Tokens
163163

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,40 @@
1-
# Destroy an Account
1+
# Close Account
22

3-
1. A `PDA` is created using the [create_user.rs](programs/destroy-an-account/src/instructions/create_user.rs) instruction.
3+
Two instruction handlers: `create_user` initializes a PDA `UserState` account, and `close_user` closes it and returns the rent to the user.
4+
5+
1. `create_user` initializes the PDA with Anchor's `init` constraint:
46

57
```rust
68
#[account(
79
init,
8-
seeds = [User::PREFIX.as_bytes(), user.key().as_ref()],
910
payer = user,
10-
space = User::SIZE,
11+
space = UserState::DISCRIMINATOR.len() + UserState::INIT_SPACE,
12+
seeds = [b"USER", user.key().as_ref()],
1113
bump,
1214
)]
13-
pub user_account: Box<Account<'info, User>>,
15+
pub user_account: Account<'info, UserState>,
1416
```
1517

16-
2. The account is closed in [destroy_user.rs](programs/destroy-an-account/src/instructions/destroy_user.rs), using Anchor's `close` helper on the account info:
18+
See [`programs/close-account/src/instructions/create_user.rs`](programs/close-account/src/instructions/create_user.rs).
19+
20+
2. `close_user` closes the account using Anchor's `close` constraint, which returns lamports to the given account:
1721

1822
```rust
19-
user_account.close(user.to_account_info())?;
23+
#[account(
24+
mut,
25+
seeds = [b"USER", user.key().as_ref()],
26+
bump = user_account.bump,
27+
close = user, // close account and return lamports to user
28+
)]
29+
pub user_account: Account<'info, UserState>,
2030
```
2131

22-
3. The test [destroy-an-account.ts](tests/destroy-an-account.ts) verifies that the account is null both before creation and after closing, via `fetchNullable`:
32+
See [`programs/close-account/src/instructions/close_user.rs`](programs/close-account/src/instructions/close_user.rs).
2333

24-
```typescript
25-
const userAccountBefore = await program.account.user.fetchNullable(userAccountAddress, "processed");
26-
assert.equal(userAccountBefore, null);
27-
// ...
28-
const userAccountAfter = await program.account.user.fetchNullable(userAccountAddress, "processed");
29-
assert.notEqual(userAccountAfter, null);
30-
```
34+
## Tests
35+
36+
Tests live in [`programs/close-account/tests/test_close_account.rs`](programs/close-account/tests/test_close_account.rs) and run against litesvm. `Anchor.toml`'s `scripts.test` is `cargo test`, so `anchor test` builds the program and runs the Rust tests:
37+
38+
```bash
39+
anchor test
40+
```

basics/cross-program-invocation/README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,22 @@ In the `lever` crate's `Cargo.toml`:
2626
no-entrypoint = []
2727
```
2828

29-
Then, in the `hand` crate, import `lever` with that feature enabled:
29+
In this example each crate also defines a `cpi` feature that depends on `no-entrypoint`, so callers can pick the more descriptive name:
30+
31+
```toml
32+
[features]
33+
no-entrypoint = []
34+
cpi = ["no-entrypoint"]
35+
```
36+
37+
Then, in the `hand` crate, import `lever` with the `cpi` feature enabled:
3038

3139
```toml
3240
[dependencies]
33-
lever = { path = "../lever", features = ["no-entrypoint"] }
41+
cross-program-invocatio-native-lever = { path = "../lever", features = ["cpi"] }
3442
```
3543

36-
In the `lever` crate, gate the `entrypoint!` macro on the feature being absent:
44+
In the `lever` crate, gate the `entrypoint!` macro on the `no-entrypoint` feature being absent:
3745

3846
```rust
3947
#[cfg(not(feature = "no-entrypoint"))]

compression/cnft-burn/anchor/README.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,16 @@ An Anchor program that burns compressed NFTs (cNFTs) in your collection. The pro
44

55
## Components
66

7-
- `programs/` — the Anchor program.
8-
- `tests/`tests for the program.
7+
- `programs/cnft-burn/` — the Anchor program.
8+
- `migrations/`deployment script.
99

10-
## Deployment
10+
There is no `tests/` directory in this example today. The program is intended to be deployed and exercised against a real cluster.
1111

12-
The program is deployed on devnet at `FbeHkUEevbhKmdk5FE5orcTaJkCYn5drwZoZXaxQXXNn`. To deploy your own copy, change the program ID in `lib.rs` and `Anchor.toml`.
12+
## Deployment
1313

14-
## How to run
14+
The program ID declared in [`programs/cnft-burn/src/lib.rs`](programs/cnft-burn/src/lib.rs) is `C6qxH8n6mZxrrbtMtYWYSp8JR8vkQ55X1o4EBg7twnMv`. Whether this address is currently deployed on any cluster is not tracked in this repo — verify with `solana program show <id>` against the cluster you care about.
1515

16-
1. Configure the RPC endpoint in `cnft-burn.ts`.
17-
2. `anchor build` from the example root.
18-
3. `anchor deploy` to deploy to your chosen cluster.
19-
4. `pnpm test` to run the tests.
16+
To deploy your own copy, change the program ID in `lib.rs` and `Anchor.toml`, then run `anchor build && anchor deploy`.
2017

2118
## Acknowledgements
2219

compression/cnft-vault/anchor/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ Use this as a reference for working with cNFTs in your own programs.
1313

1414
## Components
1515

16-
- `programs/` — the Anchor program.
17-
- `tests/` — TypeScript client-side tests.
18-
- `tests/scripts/` — standalone scripts you can run individually. `withdrawWithLookup.ts` demonstrates using the program with Address Lookup Tables.
16+
- `programs/cnft-vault/` — the Anchor program.
17+
18+
There is no `tests/` directory in this example today. The program is intended to be deployed and exercised against a real cluster.
1919

2020
## Deployment
2121

22-
Deployed on devnet at `CNftyK7T8udPwYRzZUMWzbh79rKrz9a5GwV2wv7iEHpk`. To deploy your own, change the program ID in `lib.rs` and `Anchor.toml`.
22+
The program ID declared in [`programs/cnft-vault/src/lib.rs`](programs/cnft-vault/src/lib.rs) is `Fd4iwpPWaCU8BNwGQGtvvrcvG4Tfizq3RgLm8YLBJX6D`. Whether this address is currently deployed on any cluster is not tracked in this repo — verify with `solana program show <id>` against the cluster you care about.
23+
24+
To deploy your own copy, change the program ID in `lib.rs` and `Anchor.toml`, then run `anchor build && anchor deploy`.
2325

2426
## Limitations
2527

compression/cutils/anchor/README.md

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,20 @@ Use this as a reference for working with cNFTs in your own programs.
1111

1212
## Components
1313

14-
- `programs/` — the Anchor program. The setup uses a `validate`/`actuate` pattern via Anchor's `access_control` macro; this pairs well with the cNFT verification logic.
15-
- `tests/` — TypeScript tests.
16-
- `setup.ts` — run first if you don't already have a collection with a merkle tree.
17-
- `tests.ts` — individual minting and verification tests.
14+
- `programs/cutils/` — the Anchor program. The setup uses a `validate`/`actuate` pattern via Anchor's `access_control` macro; this pairs well with the cNFT verification logic.
15+
16+
There is no `tests/` directory in this example today. The program is intended to be deployed and exercised against a real cluster.
1817

1918
## Deployment
2019

21-
Deployed on devnet at `burZc1SfqbrAP35XG63YZZ82C9Zd22QUwhCXoEUZWNF`. To deploy your own, change the program ID in `lib.rs` and `Anchor.toml`.
20+
The program ID declared in [`programs/cutils/src/lib.rs`](programs/cutils/src/lib.rs) is `BuFyrgRYzg2nPhqYrxZ7d9uYUs4VXtxH71U8EcoAfTQZ`. Whether this address is currently deployed on any cluster is not tracked in this repo — verify with `solana program show <id>` against the cluster you care about.
21+
22+
To deploy your own copy, change the program ID in `lib.rs` and `Anchor.toml`, then run `anchor build && anchor deploy`.
2223

2324
## Limitations
2425

2526
Reference implementation only.
2627

27-
**This example pins Anchor 0.26.0** because of mpl-bubblegum dependency constraints at the time of writing.
28-
29-
## How to run
30-
31-
1. Configure the RPC endpoint in `utils/readAPI.ts`.
32-
2. `cd` to the example root.
33-
3. `pnpm install`.
34-
4. (Optional) `npx tsx tests/setup.ts` to create an NFT collection and its merkle tree.
35-
5. Comment out the tests you don't want to run in `tests/tests.ts`.
36-
6. If minting, set your NFT URI.
37-
7. If verifying, set the asset ID (cNFT mint address) you want to verify.
38-
8. Run `anchor test --skip-build --skip-deploy --skip-local-validator`.
39-
9. View your cNFTs on devnet via the Solflare wallet.
40-
10. You may also want to change the wallet path in `Anchor.toml`.
41-
4228
## Acknowledgements
4329

4430
- [@nickfrosty](https://twitter.com/nickfrosty) for the sample code and [live demo](https://youtu.be/LxhTxS9DexU).

tokens/create-token/README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Create an SPL Token
1+
# Create a Token
22

3-
Create an SPL Token on Solana with metadata such as a symbol and an icon.
3+
Create a token on Solana with metadata such as a symbol and an icon.
44

5-
All tokens on Solana — including NFTs are SPL Tokens. They follow the SPL Token standard (similar in spirit to ERC-20).
5+
All fungible assets and NFTs on Solana are tokens. They follow the Classic Token Program standard (similar in spirit to ERC-20), or the newer Token Extensions standard.
66

77
```text
8-
Default SPL Tokens : 9 decimals
9-
NFTs : 0 decimals
8+
Typical fungible tokens : 9 decimals
9+
NFTs : 0 decimals
1010
```
1111

1212
## How decimals work
@@ -19,7 +19,7 @@ For a token JOE with 9 decimals:
1919

2020
## Mint and metadata
2121

22-
An SPL Token is represented onchain by a **Mint Account**:
22+
A token is represented onchain by a **Mint Account**:
2323

2424
```typescript
2525
{
@@ -41,9 +41,11 @@ Metadata about a mint — name, symbol, image URI — lives in a separate **Meta
4141
}
4242
```
4343

44-
> Metaplex is the de facto standard for SPL Token metadata on Solana. The [Metaplex Token Metadata Program](https://docs.metaplex.com/) is what creates these metadata accounts.
44+
> Metaplex is the de facto standard for token metadata on Solana with the Classic Token Program. The [Metaplex Token Metadata Program](https://docs.metaplex.com/) creates these metadata accounts.
45+
>
46+
> Tokens using the Token Extensions metadata extension store metadata directly on the mint and don't need a separate Metaplex account.
4547
46-
## Steps to create an SPL Token
48+
## Steps to create a token
4749

4850
1. Create an account for the mint.
4951
2. Initialize that account as a Mint Account.

tokens/create-token/quasar/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ declare_id!("22222222222222222222222222222222222222222222");
1111
/// Creates a token mint and mints initial tokens to the creator's token account.
1212
///
1313
/// The Anchor version uses Metaplex for onchain metadata. Quasar's metadata
14-
/// crate is demonstrated in the `nft-minter` and `spl-token-minter` examples;
14+
/// crate is demonstrated in the `nft-minter` and `token-minter` examples;
1515
/// this example focuses on the core SPL Token operations: creating a mint and
1616
/// minting tokens.
1717
#[program]

tokens/nft-minter/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# NFT Minter
22

3-
Minting NFTs is the same as [minting any SPL Token on Solana](../spl-token-minter/), with one extra step at the end.
3+
Minting NFTs is the same as [minting any token on Solana](../token-minter/), with one extra step at the end.
44

5-
When you mint SPL Tokens, you can in most cases continue to mint more tokens later, growing the supply. An NFT is supposed to have a supply of **one**. So we need to make sure no more can ever be minted.
5+
When you mint tokens, you can in most cases continue to mint more later, growing the supply. An NFT is supposed to have a supply of **one**, so no more can ever be minted.
66

77
The way to do that is to remove the mint authority from the mint:
88

0 commit comments

Comments
 (0)