mirror programs

Jonas Hahn cd403c2ff9 WIP fix CI for meta data pointer nft преди 1 година
.github cd403c2ff9 WIP fix CI for meta data pointer nft преди 1 година
.husky a3b87a4948 update: tokens native, formatter, trigger action on project changes (#81) преди 1 година
basics 23bbb4f003 Fix license on Favourites app преди 1 година
compression 2c4cb8f527 Fix: all the biome errors and update biome (#86) преди 1 година
oracles a3b87a4948 update: tokens native, formatter, trigger action on project changes (#81) преди 1 година
scripts 2c4cb8f527 Fix: all the biome errors and update biome (#86) преди 1 година
tokens cd403c2ff9 WIP fix CI for meta data pointer nft преди 1 година
tools a3b87a4948 update: tokens native, formatter, trigger action on project changes (#81) преди 1 година
.gitignore a3b87a4948 update: tokens native, formatter, trigger action on project changes (#81) преди 1 година
Cargo.lock a3b87a4948 update: tokens native, formatter, trigger action on project changes (#81) преди 1 година
Cargo.toml a3b87a4948 update: tokens native, formatter, trigger action on project changes (#81) преди 1 година
README.md 756780015a Merge branch 'main' into add-table-of-contents преди 1 година
biome.json 2c4cb8f527 Fix: all the biome errors and update biome (#86) преди 1 година
make-table-of-contents.ts 768e362832 README fixes преди 1 година
package.json 2c4cb8f527 Fix: all the biome errors and update biome (#86) преди 1 година
pnpm-lock.yaml 2c4cb8f527 Fix: all the biome errors and update biome (#86) преди 1 година
yarn.lock 2c4cb8f527 Fix: all the biome errors and update biome (#86) преди 1 година

README.md

Program Examples

Onchain program examples for :anchor: Anchor :crab: Native Rust, and :snake: Python

This repo contains Solana onchain programs (referred to as 'Smart Contracts' in other blockchains).

[!NOTE] If you're new to Solana, you don't need to create your own programs to perform basic things like making accounts, creating tokens, sending tokens, or minting NFTs. These common tasks are handled with existing programs, for example the System Program (for making account or transferring SOL) or the token program (for creating tokens and NFTs). See the Solana Developer site to learn more.

Using this repo

Each folder includes examples for one or more of the following

  • anchor - Written using Anchor, the most popular framework for Solana Development, which uses Rust. Use anchor build && anchor deploy to build & deploy the program. Run anchor run test to test it.
  • native - Written using Solana's native Rust crates and vanilla Rust. Use cicd.sh to build & deploy the program. Run yarn run test to test it.
  • seahorse - Written using the Seahorse framework, which converts your Python code to Anchor Rust. Use seahorse build && anchor deploy to build & deploy the program. Run anchor run test to test it.

If a given example is missing, please add it!

The example projects!

basics

account-data

anchor, native

checking-accounts

anchor, native

close-account

anchor, native

counter

anchor, native, seahorse

create-account

anchor, native

cross-program-invocation

anchor, native

favorites

anchor

hello-solana

anchor, native, seahorse

pda-rent-payer

anchor, native

processing-instructions

anchor, native

program-derived-addresses

anchor, native

realloc

anchor, native

rent

anchor, native

repository-layout

anchor, native

transfer-sol

anchor, native, seahorse

tokens

create-token

anchor, native

escrow

anchor

nft-minter

anchor, native

pda-mint-authority

anchor, native

spl-token-minter

anchor, native

token-swap

anchor

transfer-tokens

anchor, native, seahorse

tokens/token-2022

basics

anchor

cpi-guard

anchor

default-account-state

anchor, native

group

anchor

immutable-owner

anchor

interest-bearing

anchor

memo-transfer

anchor

metadata

anchor

mint-close-authority

anchor, native

multiple-extensions

native

non-transferable

anchor, native

permanent-delegate

anchor

transfer-fee

anchor, native

compression

cnft-burn

anchor

cnft-vault

anchor

cutils

anchor

oracles

pyth

anchor, seahorse

Examples We'd Love to See!

  • Examples needed for Native:
    • Token Extensions
  • Examples needed for Anchor:
    • Additional Accounts & Resolving Accounts
  • Examples needed for Seahorse
    • Any existing example missing a seahorse folder
  • New examples needed for Anchor, Native, Solidity & Seahorse:
    • Token lending
    • Token swapping
    • Escrow
    • Staking
    • Wrapped tokens
    • Pyth
    • Clockwork
    • VRF
    • Any oracle
    • Merkle trees (compression)