mirror programs

Joe Caulfield 0866b0ee67 Update README.md 3 years ago
README.md 0866b0ee67 Update README.md 3 years ago

README.md

Program Examples

:space_invader: Welcome, Solana Developer. :space_invader:

Do you ever look at a bunch of examples of doing things on Solana and think to yourself:

"But how do I do this on-chain?"

We present to you this list of curated examples for a wide range of use cases implemented using on-chain programs.

: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:

*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
  • [] 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
  • [] 1. A simple PDA
  • [] 2. Dynamic PDA creation
  • ### PDA Programming Model
  • [] 1. Twitter
  • [] 2. Amazon
  • [] 3. OpenSea