Browse Source

delete solang

John 1 year ago
parent
commit
a7bf77e04b

+ 29 - 31
README.md

@@ -1,58 +1,56 @@
 # Program Examples
 
-### :crab: Rust. :snake: Python. :ice_cube: Solidity. :link: All on-chain. 
-
-> **New:** Solidity examples from Solang!
+### :crab: Rust. :snake: Python. :link: All on-chain.
 
 ## Navigating this Repo
 
 :file_folder: Each example contains four 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.
 - `seahorse` - Written using the Python framework Seahorse, which converts your Python code to Anchor Rust.
-- `solang` - Written using the Solang compiler, which allows developers to run Solidity natively on Solana.
 
 :wrench: How to build & run:
+
 - Before running anything in any folder make sure you pull in the dependencies with `yarn install`.
 - `native` - Use `cicd.sh` to build & deploy the program. Run `yarn run test` to test it.
 - `anchor` - Use `anchor build && anchor deploy` to build & deploy the program. Run `anchor run test` to test it.
 - `seahorse` - Use `seahorse build && anchor deploy` to build & deploy the program. Run `anchor run test` to test it.
-- `solang` - Use `anchor build && anchor deploy` to build & deploy the program. Run `anchor run test` to test it.
 
 ## Examples We'd Love to See!
 
-* Examples needed for Native:
-    * Token2022
-* Examples needed for Anchor:
-    * Additional Accounts & Resolving Accounts
-* Examples needed for Seahorse
-    * Any existing example missing a `seahorse` folder
-* Examples needed for Solidity
-    * Any existing example missing a `solang` folder
-* New examples needed for Solidity, Anchor, Native & Seahorse:
-    * Token lending
-    * Token swapping
-    * Escrow
-    * Staking
-    * Wrapped tokens
-    * Pyth
-    * Clockwork
-    * VRF
-    * Any oracle
-    * Merkle trees (compression)
+- Examples needed for Native:
+  - Token2022
+- Examples needed for Anchor:
+  - Additional Accounts & Resolving Accounts
+- Examples needed for Seahorse
+  - Any existing example missing a `seahorse` folder
+- New examples needed for Solidity, Anchor, Native & Seahorse:
+  - Token lending
+  - Token swapping
+  - Escrow
+  - Staking
+  - Wrapped tokens
+  - Pyth
+  - Clockwork
+  - VRF
+  - Any oracle
+  - Merkle trees (compression)
 
 ---
 
 ## If You're New To Solana Please Read
-Most system-level operations on Solana involve already-existing Solana programs.   
-   
-For example, to create a **system account** you use the **system program** and to create a **token mint** you use the **token program**.   
-   
-So, you'll notice that these operations are in fact conducting what's called a **cross-program invocation** - which is a fancy way of saying it calls other Solana programs to do business. You can see this in action whenever you see `invoke` or `invoke_signed` in the `native` examples, or `CpiContext` in the `anchor` examples.   
-   
+
+Most system-level operations on Solana involve already-existing Solana programs.
+
+For example, to create a **system account** you use the **system program** and to create a **token mint** you use the **token program**.
+
+So, you'll notice that these operations are in fact conducting what's called a **cross-program invocation** - which is a fancy way of saying it calls other Solana programs to do business. You can see this in action whenever you see `invoke` or `invoke_signed` in the `native` examples, or `CpiContext` in the `anchor` examples.
+
 Deciding when to use cross-program invocation instead of invoking the programs directly from the client is completely up to you as the builder. It depends on how your application is designed.
+
 - Maybe you want to add some checks - such as minimum balance required, allowed ownership, etc.
 - Maybe you want to assert that an account has a certain data type.
 - Perhaps you want to send only one instruction from your client for a handful of sequential operations.
 - The list goes on.
-Regardless of what you may want to add on top of existing Solana programs, the number one use case for writing your own program is for using accounts with a **Program Derived Address (PDA)**. Crack open the `pdas` folder to see why.
+  Regardless of what you may want to add on top of existing Solana programs, the number one use case for writing your own program is for using accounts with a **Program Derived Address (PDA)**. Crack open the `pdas` folder to see why.

+ 0 - 19
basics/account-data/solang/package.json

@@ -1,19 +0,0 @@
-{
-    "scripts": {
-        "lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w",
-        "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
-    },
-    "dependencies": {
-        "@coral-xyz/anchor": "^0.30.0"
-    },
-    "devDependencies": {
-        "chai": "^4.3.4",
-        "mocha": "^9.0.3",
-        "ts-mocha": "^10.0.0",
-        "@types/bn.js": "^5.1.0",
-        "@types/chai": "^4.3.0",
-        "@types/mocha": "^9.0.0",
-        "typescript": "^4.3.5",
-        "prettier": "^2.6.2"
-    }
-}

+ 0 - 19
basics/checking-accounts/solang/package.json

@@ -1,19 +0,0 @@
-{
-    "scripts": {
-        "lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w",
-        "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
-    },
-    "dependencies": {
-        "@coral-xyz/anchor": "^0.30.0"
-    },
-    "devDependencies": {
-        "chai": "^4.3.4",
-        "mocha": "^9.0.3",
-        "ts-mocha": "^10.0.0",
-        "@types/bn.js": "^5.1.0",
-        "@types/chai": "^4.3.0",
-        "@types/mocha": "^9.0.0",
-        "typescript": "^4.3.5",
-        "prettier": "^2.6.2"
-    }
-}

+ 0 - 19
basics/counter/solang/package.json

@@ -1,19 +0,0 @@
-{
-    "scripts": {
-        "lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w",
-        "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
-    },
-    "dependencies": {
-        "@coral-xyz/anchor": "^0.30.0"
-    },
-    "devDependencies": {
-        "chai": "^4.3.4",
-        "mocha": "^9.0.3",
-        "ts-mocha": "^10.0.0",
-        "@types/bn.js": "^5.1.0",
-        "@types/chai": "^4.3.0",
-        "@types/mocha": "^9.0.0",
-        "typescript": "^4.3.5",
-        "prettier": "^2.6.2"
-    }
-}

+ 0 - 19
basics/cross-program-invocation/solang/package.json

@@ -1,19 +0,0 @@
-{
-    "scripts": {
-        "lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w",
-        "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
-    },
-    "dependencies": {
-        "@coral-xyz/anchor": "^0.30.0"
-    },
-    "devDependencies": {
-        "chai": "^4.3.4",
-        "mocha": "^9.0.3",
-        "ts-mocha": "^10.0.0",
-        "@types/bn.js": "^5.1.0",
-        "@types/chai": "^4.3.0",
-        "@types/mocha": "^9.0.0",
-        "typescript": "^4.3.5",
-        "prettier": "^2.6.2"
-    }
-}

+ 0 - 19
basics/hello-solana/solang/package.json

@@ -1,19 +0,0 @@
-{
-    "scripts": {
-        "lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w",
-        "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
-    },
-    "dependencies": {
-        "@coral-xyz/anchor": "^0.30.0"
-    },
-    "devDependencies": {
-        "chai": "^4.3.4",
-        "mocha": "^9.0.3",
-        "ts-mocha": "^10.0.0",
-        "@types/bn.js": "^5.1.0",
-        "@types/chai": "^4.3.0",
-        "@types/mocha": "^9.0.0",
-        "typescript": "^4.3.5",
-        "prettier": "^2.6.2"
-    }
-}

+ 0 - 19
basics/pda-rent-payer/solang/package.json

@@ -1,19 +0,0 @@
-{
-    "scripts": {
-        "lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w",
-        "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
-    },
-    "dependencies": {
-        "@coral-xyz/anchor": "^0.30.0"
-    },
-    "devDependencies": {
-        "chai": "^4.3.4",
-        "mocha": "^9.0.3",
-        "ts-mocha": "^10.0.0",
-        "@types/bn.js": "^5.1.0",
-        "@types/chai": "^4.3.0",
-        "@types/mocha": "^9.0.0",
-        "typescript": "^4.3.5",
-        "prettier": "^2.6.2"
-    }
-}

+ 0 - 19
basics/processing-instructions/solang/package.json

@@ -1,19 +0,0 @@
-{
-    "scripts": {
-        "lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w",
-        "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
-    },
-    "dependencies": {
-        "@coral-xyz/anchor": "^0.30.0"
-    },
-    "devDependencies": {
-        "chai": "^4.3.4",
-        "mocha": "^9.0.3",
-        "ts-mocha": "^10.0.0",
-        "@types/bn.js": "^5.1.0",
-        "@types/chai": "^4.3.0",
-        "@types/mocha": "^9.0.0",
-        "typescript": "^4.3.5",
-        "prettier": "^2.6.2"
-    }
-}

+ 0 - 19
basics/program-derived-addresses/solang/package.json

@@ -1,19 +0,0 @@
-{
-    "scripts": {
-        "lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w",
-        "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
-    },
-    "dependencies": {
-        "@coral-xyz/anchor": "^0.30.0"
-    },
-    "devDependencies": {
-        "chai": "^4.3.4",
-        "mocha": "^9.0.3",
-        "ts-mocha": "^10.0.0",
-        "@types/bn.js": "^5.1.0",
-        "@types/chai": "^4.3.0",
-        "@types/mocha": "^9.0.0",
-        "typescript": "^4.3.5",
-        "prettier": "^2.6.2"
-    }
-}

+ 0 - 19
basics/rent/solang/package.json

@@ -1,19 +0,0 @@
-{
-    "scripts": {
-        "lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w",
-        "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
-    },
-    "dependencies": {
-        "@coral-xyz/anchor": "^0.30.0"
-    },
-    "devDependencies": {
-        "chai": "^4.3.4",
-        "mocha": "^9.0.3",
-        "ts-mocha": "^10.0.0",
-        "@types/bn.js": "^5.1.0",
-        "@types/chai": "^4.3.0",
-        "@types/mocha": "^9.0.0",
-        "typescript": "^4.3.5",
-        "prettier": "^2.6.2"
-    }
-}

+ 0 - 19
basics/transfer-sol/solang/package.json

@@ -1,19 +0,0 @@
-{
-    "scripts": {
-        "lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w",
-        "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
-    },
-    "dependencies": {
-        "@coral-xyz/anchor": "^0.30.0"
-    },
-    "devDependencies": {
-        "chai": "^4.3.4",
-        "mocha": "^9.0.3",
-        "ts-mocha": "^10.0.0",
-        "@types/bn.js": "^5.1.0",
-        "@types/chai": "^4.3.0",
-        "@types/mocha": "^9.0.0",
-        "typescript": "^4.3.5",
-        "prettier": "^2.6.2"
-    }
-}

+ 0 - 37
compression/cnft-solang/app/package.json

@@ -1,37 +0,0 @@
-{
-  "name": "wallet-adapter-chakraui-nextjs",
-  "version": "0.1.0",
-  "private": true,
-  "scripts": {
-    "dev": "next dev",
-    "build": "next build",
-    "start": "next start",
-    "lint": "next lint"
-  },
-  "dependencies": {
-    "@chakra-ui/next-js": "^2.1.3",
-    "@chakra-ui/react": "^2.6.1",
-    "@coral-xyz/anchor": "^0.30.0",
-    "@emotion/react": "^11.11.0",
-    "@emotion/styled": "^11.11.0",
-    "@metaplex-foundation/mpl-bubblegum": "^0.7.0",
-    "@solana/pay": "^0.2.5",
-    "@solana/spl-account-compression": "^0.1.8",
-    "@solana/wallet-adapter-base": "^0.9.22",
-    "@solana/wallet-adapter-react": "^0.15.32",
-    "@solana/wallet-adapter-react-ui": "^0.9.31",
-    "@solana/wallet-adapter-wallets": "^0.19.16",
-    "@solana/web3.js": "^1.77.1",
-    "@types/node": "20.2.5",
-    "@types/react": "18.2.7",
-    "@types/react-dom": "18.2.4",
-    "eslint": "8.41.0",
-    "eslint-config-next": "13.4.4",
-    "framer-motion": "^10.12.16",
-    "next": "13.4.4",
-    "react": "18.2.0",
-    "react-circular-progressbar": "^2.1.0",
-    "react-dom": "18.2.0",
-    "typescript": "5.0.4"
-  }
-}

+ 0 - 21
compression/cnft-solang/package.json

@@ -1,21 +0,0 @@
-{
-    "scripts": {
-        "lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w",
-        "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
-    },
-    "dependencies": {
-        "@coral-xyz/anchor": "^0.30.0",
-        "@metaplex-foundation/mpl-bubblegum": "^0.7.0",
-        "@solana/spl-account-compression": "^0.1.8"
-    },
-    "devDependencies": {
-        "@types/bn.js": "^5.1.0",
-        "@types/chai": "^4.3.0",
-        "@types/mocha": "^9.0.0",
-        "chai": "^4.3.4",
-        "mocha": "^9.0.3",
-        "prettier": "^2.6.2",
-        "ts-mocha": "^10.0.0",
-        "typescript": "^4.3.5"
-    }
-}

+ 1 - 1
package.json

@@ -1,7 +1,7 @@
 {
   "name": "program-examples",
   "version": "1.0.0",
-  "description": "### :crab: Rust. :snake: Python. :ice_cube: Solidity. :link: All on-chain.",
+  "description": "### :crab: Rust. :snake: Python. :link: All on-chain.",
   "scripts": {
     "sync-package-json": "ts-node scripts/sync-package-json.ts"
   },

+ 0 - 21
tokens/create-token/solang/package.json

@@ -1,21 +0,0 @@
-{
-    "scripts": {
-        "lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w",
-        "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
-    },
-    "dependencies": {
-        "@coral-xyz/anchor": "^0.30.0",
-        "@metaplex-foundation/js": "^0.19.4",
-        "@project-serum/anchor": "^0.26.0"
-    },
-    "devDependencies": {
-        "@types/bn.js": "^5.1.0",
-        "@types/chai": "^4.3.0",
-        "@types/mocha": "^9.0.0",
-        "chai": "^4.3.4",
-        "mocha": "^9.0.3",
-        "prettier": "^2.6.2",
-        "ts-mocha": "^10.0.0",
-        "typescript": "^4.3.5"
-    }
-}

+ 0 - 22
tokens/nft-minter/solang/package.json

@@ -1,22 +0,0 @@
-{
-    "scripts": {
-        "lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w",
-        "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
-    },
-    "dependencies": {
-        "@coral-xyz/anchor": "^0.30.0",
-        "@metaplex-foundation/js": "^0.19.4",
-        "@project-serum/anchor": "^0.26.0",
-        "@solana/spl-token": "^0.3.8"
-    },
-    "devDependencies": {
-        "@types/bn.js": "^5.1.0",
-        "@types/chai": "^4.3.0",
-        "@types/mocha": "^9.0.0",
-        "chai": "^4.3.4",
-        "mocha": "^9.0.3",
-        "prettier": "^2.6.2",
-        "ts-mocha": "^10.0.0",
-        "typescript": "^4.3.5"
-    }
-}

+ 0 - 22
tokens/pda-mint-authority/solang/package.json

@@ -1,22 +0,0 @@
-{
-    "scripts": {
-        "lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w",
-        "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
-    },
-    "dependencies": {
-        "@coral-xyz/anchor": "^0.30.0",
-        "@metaplex-foundation/js": "^0.19.4",
-        "@project-serum/anchor": "^0.26.0",
-        "@solana/spl-token": "^0.3.8"
-    },
-    "devDependencies": {
-        "@types/bn.js": "^5.1.0",
-        "@types/chai": "^4.3.0",
-        "@types/mocha": "^9.0.0",
-        "chai": "^4.3.4",
-        "mocha": "^9.0.3",
-        "prettier": "^2.6.2",
-        "ts-mocha": "^10.0.0",
-        "typescript": "^4.3.5"
-    }
-}

+ 0 - 22
tokens/spl-token-minter/solang/package.json

@@ -1,22 +0,0 @@
-{
-    "scripts": {
-        "lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w",
-        "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
-    },
-    "dependencies": {
-        "@coral-xyz/anchor": "^0.30.0",
-        "@metaplex-foundation/js": "^0.19.4",
-        "@project-serum/anchor": "^0.26.0",
-        "@solana/spl-token": "^0.3.8"
-    },
-    "devDependencies": {
-        "@types/bn.js": "^5.1.0",
-        "@types/chai": "^4.3.0",
-        "@types/mocha": "^9.0.0",
-        "chai": "^4.3.4",
-        "mocha": "^9.0.3",
-        "prettier": "^2.6.2",
-        "ts-mocha": "^10.0.0",
-        "typescript": "^4.3.5"
-    }
-}

+ 0 - 22
tokens/transfer-tokens/solang/package.json

@@ -1,22 +0,0 @@
-{
-    "scripts": {
-        "lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w",
-        "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
-    },
-    "dependencies": {
-        "@coral-xyz/anchor": "^0.30.0",
-        "@metaplex-foundation/js": "^0.19.4",
-        "@project-serum/anchor": "^0.26.0",
-        "@solana/spl-token": "^0.3.8"
-    },
-    "devDependencies": {
-        "@types/bn.js": "^5.1.0",
-        "@types/chai": "^4.3.0",
-        "@types/mocha": "^9.0.0",
-        "chai": "^4.3.4",
-        "mocha": "^9.0.3",
-        "prettier": "^2.6.2",
-        "ts-mocha": "^10.0.0",
-        "typescript": "^4.3.5"
-    }
-}