Browse Source

Draft: update README.md for when CI passes all projects

Mike MacCana 1 year ago
parent
commit
5116b5918d
1 changed files with 73 additions and 45 deletions
  1. 73 45
      README.md

+ 73 - 45
README.md

@@ -1,19 +1,30 @@
-# Program Examples
+# Example Solana onchain programs ('smart contracts')
 
-## 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](https://solana.com/developers) to learn more.
+> [!NOTE] If you're familiar with older blockchains, **you don't need to create
+> your own programs to perform common tasks** like making accounts, creating
+> tokens, sending tokens, or minting NFTs. These are handled with existing
+> programs, for example the System Program (for making accounts or transferring
+> SOL) or the token program (for creating tokens and NFTs). See the
+> [Solana Developer site](https://solana.com/developers) to learn more.
 
 Each folder includes examples for one or more of the following
 
-- `anchor` - Written using [Anchor](https://www.anchor-lang.com/), 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](https://seahorse-lang.org/), 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.
+- :anchor: `anchor` - written using [Anchor](https://www.anchor-lang.com/), the
+  most popular framework for Solana Development.
+  - Use `anchor build && anchor deploy` to build & deploy the program. Run
+    `anchor run test` to test it.
+- :crab: `native` - written using Solana's
+  [native Rust crates](https://solana.com/developers/guides/getstarted/intro-to-native-rust)
+  and vanilla Rust.
+  - Use `cicd.sh` to build & deploy the program. Run `yarn run test` to test it.
 
-**If a given example is missing, please send us a PR to add it!** Our aim is to have every examples available in every option. We'd also love to see more programs involving staking, wrapped tokens, oracles, compression and VRF. Follow the [contributing guidelines](./CONTRIBUTING.md) to keep things consistent.
+**To ensure they're up to date, each of these examples are
+[checked on commit with the current version of Solana and Anchor](https://github.com/solana-developers/program-examples/blob/main/.github/workflows/anchor.yml#L22).**
+
+PRs are welcome! Our aim is to have every examples available in every option.
+We'd also love to see more programs involving staking, wrapped tokens, oracles,
+compression and VRF. Follow the [contributing guidelines](./CONTRIBUTING.md) to
+keep things consistent.
 
 <details>
   <summary>Basics</summary>
@@ -22,8 +33,6 @@ Each folder includes examples for one or more of the following
 
 [Hello World on Solana! A minimal program that logs a greeting.](./basics/hello-solana/README.md)
 
-[anchor](./basics/hello-solana/anchor) [native](./basics/hello-solana/native) [seahorse](./basics/hello-solana/seahorse)
-
 ### Account-data
 
 Store and retrieve data using Solana accounts.
@@ -34,11 +43,10 @@ Store and retrieve data using Solana accounts.
 
 [Use a PDA to store global state, making a counter that increments when called.](./basics/counter/README.md)
 
-[anchor](./basics/counter/anchor) [native](./basics/counter/native) [seahorse](./basics/counter/seahorse)
-
 ### Saving per-user state - Favorites
 
-Save and update per-user state on the blockchain, ensuring users can only update their own information.
+Save and update per-user state on the blockchain, ensuring users can only update
+their own information.
 
 [anchor](./basics/favorites/anchor)
 
@@ -46,7 +54,8 @@ Save and update per-user state on the blockchain, ensuring users can only update
 
 [Check that the accounts provided in incoming instructions meet particular criteria.](./basics/checking-accounts/README.md)
 
-[anchor](./basics/checking-accounts/anchor) [native](./basics/checking-accounts/native)
+[anchor](./basics/checking-accounts/anchor)
+[native](./basics/checking-accounts/native)
 
 ### Closing Accounts
 
@@ -58,31 +67,36 @@ Close an account and get the Lamports back.
 
 [Make new accounts on the blockchain.](./basics/create-account/README.md)
 
-[anchor](./basics/create-account/anchor) [native](./basics/create-account/native)
+[anchor](./basics/create-account/anchor)
+[native](./basics/create-account/native)
 
 ### Cross program invocations
 
 [Invoke an instruction handler from one onchain program in another onchain program.](./basics/cross-program-invocation/README.md)
 
-[anchor](./basics/cross-program-invocation/anchor) [native](./basics/cross-program-invocation/native)
+[anchor](./basics/cross-program-invocation/anchor)
+[native](./basics/cross-program-invocation/native)
 
 ### PDA pda-rent-payer
 
 [Use a PDA to pay the rent for the creation of a new account.](./basics/pda-rent-payer/README.md)
 
-[anchor](./basics/pda-rent-payer/anchor) [native](./basics/pda-rent-payer/native)
+[anchor](./basics/pda-rent-payer/anchor)
+[native](./basics/pda-rent-payer/native)
 
 ### Processing instructions
 
 [Add parameters to an instruction handler and use them.](./basics/processing-instructions/README.md)
 
-[anchor](./basics/processing-instructions/anchor) [native](./basics/processing-instructions/native)
+[anchor](./basics/processing-instructions/anchor)
+[native](./basics/processing-instructions/native)
 
 ### Storing date in program derived addresses
 
 Store and retrieve state in Solana.
 
-[anchor](./basics/program-derived-addresses/anchor) [native](./basics/program-derived-addresses/native)
+[anchor](./basics/program-derived-addresses/anchor)
+[native](./basics/program-derived-addresses/native)
 
 ### Handling accounts that expland in size
 
@@ -100,14 +114,13 @@ How to store state that changes size in Solana.
 
 [Layout larger Solana onchain programs.](./basics/repository-layout/README.md)
 
-[anchor](./basics/repository-layout/anchor) [native](./basics/repository-layout/native)
+[anchor](./basics/repository-layout/anchor)
+[native](./basics/repository-layout/native)
 
 ### Transferring SOL
 
 [Send SOL between two accounts.](./basics/transfer-sol/README.md)
 
-[anchor](./basics/transfer-sol/anchor) [native](./basics/transfer-sol/native) [seahorse](./basics/transfer-sol/seahorse)
-
 </details>
 <details>
   <summary>Tokens</summary>
@@ -120,33 +133,40 @@ How to store state that changes size in Solana.
 
 ### Minting NFTS
 
-[Mint an NFT from inside your own onchain program using the Token and Metaplex Token Metadata programs.](./tokens/nft-minter/README.md) Reminder: you don't need your own program just to mint an NFT, see the note at the top of this README.
+[Mint an NFT from inside your own onchain program using the Token and Metaplex Token Metadata programs.](./tokens/nft-minter/README.md)
+Reminder: you don't need your own program just to mint an NFT, see the note at
+the top of this README.
 
 [anchor](./tokens/nft-minter/anchor) [native](./tokens/nft-minter/native)
 
 ### Minting a token from inside a program
 
-[Mint a Token from inside your own onchain program using the Token program.](./tokens/spl-token-minter/README.md) Reminder: you don't need your own program just to mint an NFT, see the note at the top of this README.
+[Mint a Token from inside your own onchain program using the Token program.](./tokens/spl-token-minter/README.md)
+Reminder: you don't need your own program just to mint an NFT, see the note at
+the top of this README.
 
-[anchor](./tokens/spl-token-minter/anchor) [native](./tokens/spl-token-minter/native)
+[anchor](./tokens/spl-token-minter/anchor)
+[native](./tokens/spl-token-minter/native)
 
 ### Transferring Tokens
 
 [Transfer tokens between accounts](./tokens/transfer-tokens/README.md)
 
-[anchor](./tokens/transfer-tokens/anchor) [native](./tokens/transfer-tokens/native) [seahorse](./tokens/transfer-tokens/seahorse)
-
 ### Allowing users to swap digital assets - Escrow
 
-Allow two users to swap digital assets with each other, each getting 100% of what the other has offered due to the power of decentralization!
+Allow two users to swap digital assets with each other, each getting 100% of
+what the other has offered due to the power of decentralization!
 
 [anchor](./tokens/escrow/anchor)
 
 ### Minting a token from inside a program with a PDA as the mint authority
 
-[Mint a Token from inside your own onchain program using the Token program.](./tokens/pda-mint-authority/README.md) Reminder: you don't need your own program just to mint an NFT, see the note at the top of this README.
+[Mint a Token from inside your own onchain program using the Token program.](./tokens/pda-mint-authority/README.md)
+Reminder: you don't need your own program just to mint an NFT, see the note at
+the top of this README.
 
-[anchor](./tokens/pda-mint-authority/anchor) [native](./tokens/pda-mint-authority/native)
+[anchor](./tokens/pda-mint-authority/anchor)
+[native](./tokens/pda-mint-authority/native)
 
 ### Creating an Automated Market Maker
 
@@ -168,7 +188,8 @@ Create token mints, mint tokens, and transferr tokens using Token Extensions.
 
 ### Preventing CPIs with CPI guard
 
-Enable CPI guard to prevents certain token action from occurring within CPI (Cross-Program Invocation).
+Enable CPI guard to prevents certain token action from occurring within CPI
+(Cross-Program Invocation).
 
 [anchor](./tokens/token-2022/cpi-guard/anchor)
 
@@ -176,11 +197,13 @@ Enable CPI guard to prevents certain token action from occurring within CPI (Cro
 
 Create new token accounts that are frozen by default.
 
-[anchor](./tokens/token-2022/default-account-state/anchor) [native](./tokens/token-2022/default-account-state/native)
+[anchor](./tokens/token-2022/default-account-state/anchor)
+[native](./tokens/token-2022/default-account-state/native)
 
 ### Grouping tokens
 
-Create tokens that belong to larger groups of tokens using the Group Pointer extension.
+Create tokens that belong to larger groups of tokens using the Group Pointer
+extension.
 
 [anchor](./tokens/token-2022/group/anchor)
 
@@ -198,13 +221,15 @@ Create tokens that show an 'interest' calculation.
 
 ### Requiring transactions to include descriptive memos
 
-Create tokens where transfers must have a memo describing the transaction attached.
+Create tokens where transfers must have a memo describing the transaction
+attached.
 
 [anchor](./tokens/token-2022/memo-transfer/anchor)
 
 ### Adding on-chain metadata to the token mint
 
-Create tokens that store their onchain metadata inside the token mint, without needing to use or pay for additional programs.
+Create tokens that store their onchain metadata inside the token mint, without
+needing to use or pay for additional programs.
 
 [anchor](./tokens/token-2022/metadata/anchor)
 
@@ -212,7 +237,8 @@ Create tokens that store their onchain metadata inside the token mint, without n
 
 Allow a designated account to close a Mint.
 
-[anchor](./tokens/token-2022/mint-close-authority/anchor) [native](./tokens/token-2022/mint-close-authority/native)
+[anchor](./tokens/token-2022/mint-close-authority/anchor)
+[native](./tokens/token-2022/mint-close-authority/native)
 
 ### Usng multiple token extensions
 
@@ -224,11 +250,13 @@ Use multiple Token Extensions at once.
 
 Create tokens that cannot be transferred.
 
-[anchor](./tokens/token-2022/non-transferable/anchor) [native](./tokens/token-2022/non-transferable/native)
+[anchor](./tokens/token-2022/non-transferable/anchor)
+[native](./tokens/token-2022/non-transferable/native)
 
 ### Permanent Delegate - Create tokens permanently under the control of a particular account
 
-Create tokens that remain under the control of an account, even when transferred elsewhere.
+Create tokens that remain under the control of an account, even when transferred
+elsewhere.
 
 [anchor](./tokens/token-2022/permanent-delegate/anchor)
 
@@ -236,7 +264,8 @@ Create tokens that remain under the control of an account, even when transferred
 
 Create tokens with an inbuilt transfer fee.
 
-[anchor](./tokens/token-2022/transfer-fee/anchor) [native](./tokens/token-2022/transfer-fee/native)
+[anchor](./tokens/token-2022/transfer-fee/anchor)
+[native](./tokens/token-2022/transfer-fee/native)
 
 </details>
 <details>
@@ -269,9 +298,8 @@ Work with Metaplex compressed NFTs.
 
 ### pyth
 
-Use a data source for offchain data (called an Oracle) to perform activities onchain.
-
-[anchor](./oracles/pyth/anchor) [seahorse](./oracles/pyth/seahorse)
+Use a data source for offchain data (called an Oracle) to perform activities
+onchain.
 
 </details>