|
@@ -10,16 +10,45 @@ We present to you this list of curated examples for a wide range of use cases im
|
|
|
|
|
|
:link: All on-chain. :crab: All Rust. :muscle: All the time.
|
|
|
|
|
|
+## Navigating this Repo
|
|
|
+
|
|
|
+This collection is organized into the following sections:
|
|
|
+- `program-basics` - The basics of writing Solana programs in Rust.
|
|
|
+- `accounts`- Examples of creating & modifying accounts from on-chain.
|
|
|
+- `tokens` - Examples of working with SPL Tokens from on-chain.
|
|
|
+- `nfts` - Examples for various NFT use cases (including MetaPlex).
|
|
|
+- `pdas` - Everything you need to know about working with Program Derived Addresses & program-owned accounts.
|
|
|
+- `pda-programming-model` - Common Web2 design patterns implemented with PDAs on Solana.
|
|
|
+
|
|
|
+Each example contains two folders:
|
|
|
+- `native` - Written using Solana's native Rust crates and vanilla Rust.
|
|
|
+- `anchor` - Written using Anchor's `anchor_lang` Rust crate and the associated Anchor framework to build & deploy.
|
|
|
+
|
|
|
## To-Do:
|
|
|
-- ### Basics
|
|
|
-- :flashlight: *Each of these examples can be done with existing programs or `invoke`.*
|
|
|
-- [] Example: Creating an account
|
|
|
-- [] Example: Transferring SOL
|
|
|
+**Got something you want to see here? Add it to the list. Or better yet, write one & create a PR!*
|
|
|
+- ### Program Basics
|
|
|
+- [] 1. Processing an instruction
|
|
|
+- [] 2. Custom instruction data
|
|
|
+- [] 3. Recommended program layout
|
|
|
+- [] 4. Custom instruction data expanded
|
|
|
+- ### Accounts
|
|
|
+- [] 1. Creating an account
|
|
|
+- [] 2. Modifying an account's data
|
|
|
+- [] 3. Transferring SOL
|
|
|
+- [] 4. Transferring an account's ownership
|
|
|
+- [] 5. Destroying an account
|
|
|
- ### Tokens
|
|
|
-- :flashlight: *Each of these examples can be done with existing programs or `invoke`.*
|
|
|
-- [] Example: Creating an SPL Token
|
|
|
-- [] Example: Transferring tokens
|
|
|
-- [] Example: Creating an NFT
|
|
|
-- [] Example: Adding metadata to an NFT
|
|
|
+- [] 1. Creating an SPL Token
|
|
|
+- [] 2. Transferring tokens
|
|
|
+- ### NFTs
|
|
|
+- [] 1. Creating an NFT
|
|
|
+- [] 2. Transferring an NFT
|
|
|
+- [] 3. Adding metadata to an NFT
|
|
|
+- [] 4. NFT metadata expanded
|
|
|
- ### PDAs
|
|
|
-- [] Example: ??
|
|
|
+- [] 1. A simple PDA
|
|
|
+- [] 2. Dynamic PDA creation
|
|
|
+- ### PDA Programming Model
|
|
|
+- [] 1. Twitter
|
|
|
+- [] 2. Amazon
|
|
|
+- [] 3. OpenSea
|