Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/.ghaignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ tokens/escrow/steel
tokens/pda-mint-authority/steel
tokens/spl-token-minter/steel
tokens/token-swap/steel
tokens/transfer-tokens/steel
tokens/transfer-tokens/steel
33 changes: 15 additions & 18 deletions .github/workflows/anchor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ on:
push:
branches:
- main
- anchor-1.0
- fix-biome-errors
pull_request:
types: [opened, synchronize, reopened]
branches:
Expand All @@ -17,10 +15,6 @@ env:
MAX_JOBS: 64
MIN_PROJECTS_PER_JOB: 4
MIN_PROJECTS_FOR_MATRIX: 4
# Force all JavaScript-based actions to use Node.js 24 runtime.
# Node.js 20 actions are deprecated and will stop working June 2026.
# This catches composite actions whose internal dependencies still reference @v4.
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
changes:
Expand Down Expand Up @@ -110,18 +104,20 @@ jobs:
failed_projects: ${{ steps.set-failed.outputs.failed_projects }}
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: heyAyushh/setup-anchor@v4.999
with:
anchor-version: 0.32.1
solana-cli-version: stable
- name: Display Versions and Install pnpm
- name: Display Versions
run: |
solana -V
# it's okay to use --force in github action since all programs are tested in isolation
solana-keygen new --no-bip39-passphrase --force
rustc -V
anchor -V
npm i -g pnpm
- name: Build and Test
env:
TOTAL_PROJECTS: ${{ needs.changes.outputs.total_projects }}
Expand All @@ -132,25 +128,26 @@ jobs:
echo "Building and Testing $project"
cd "$project" || return 1

# Install dependencies first
if ! pnpm install --frozen-lockfile; then
echo "::error::pnpm install failed for $project"
echo "$project: pnpm install failed" >> $GITHUB_WORKSPACE/failed_projects.txt
# Build first — generates IDL and types that pnpm install/tests need
if ! anchor build; then
echo "::error::anchor build failed for $project"
echo "$project: anchor build failed" >> $GITHUB_WORKSPACE/failed_projects.txt
rm -rf target
cd - > /dev/null
return 1
fi

# Run anchor build
if ! anchor build; then
echo "::error::anchor build failed for $project"
echo "$project: anchor build failed" >> $GITHUB_WORKSPACE/failed_projects.txt
# Install dependencies (after build so generated types are available)
if ! pnpm install --frozen-lockfile; then
echo "::error::pnpm install failed for $project"
echo "$project: pnpm install failed" >> $GITHUB_WORKSPACE/failed_projects.txt
rm -rf target
cd - > /dev/null
return 1
fi

# Run anchor test
if ! anchor test; then
# Run anchor test (--skip-build since we already built above)
if ! anchor test --skip-build; then
echo "::error::anchor test failed for $project"
echo "$project: anchor test failed" >> $GITHUB_WORKSPACE/failed_projects.txt
rm -rf target node_modules
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,11 @@ on:
push:
branches:
- main
- anchor-1.0
- fix-biome-errors
pull_request:
types: [opened, synchronize, reopened]
branches:
- main

env:
# Force all JavaScript-based actions to use Node.js 24 runtime.
# Node.js 20 actions are deprecated and will stop working June 2026.
# This catches composite actions whose internal dependencies still reference @v4.
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

# A workflow run is made up of one or more jobs, which run in parallel by default
# Each job runs in a runner environment specified by runs-on
jobs:
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/solana-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
push:
branches:
- main
- fix-biome-errors
pull_request:
types: [opened, synchronize, reopened]
branches:
Expand All @@ -16,10 +15,6 @@ env:
MAX_JOBS: 64
MIN_PROJECTS_PER_JOB: 4
MIN_PROJECTS_FOR_MATRIX: 4
# Force all JavaScript-based actions to use Node.js 24 runtime.
# Node.js 20 actions are deprecated and will stop working June 2026.
# This catches composite actions whose internal dependencies still reference @v4.
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
changes:
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/solana-pinocchio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
push:
branches:
- main
- fix-biome-errors
pull_request:
types: [opened, synchronize, reopened]
branches:
Expand All @@ -16,10 +15,6 @@ env:
MAX_JOBS: 64
MIN_PROJECTS_PER_JOB: 4
MIN_PROJECTS_FOR_MATRIX: 4
# Force all JavaScript-based actions to use Node.js 24 runtime.
# Node.js 20 actions are deprecated and will stop working June 2026.
# This catches composite actions whose internal dependencies still reference @v4.
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
changes:
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/typescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@ on:
push:
branches:
- main
- fix-biome-errors
pull_request:
types: [opened, synchronize, reopened]
branches:
- main

env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
biome:
name: Biome check
Expand Down
38 changes: 5 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ This repo contains Solana onchain programs (referred to as 'Smart Contracts' in
> ⚠️ This repository uses **pnpm** as the default package manager.
> Ensure pnpm is installed before running any examples.


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.
Expand All @@ -27,14 +26,10 @@ Each folder includes examples for one or more of the following:
Build and test commands are the same as native examples.
Run `pnpm test` to execute tests.


**If a given example is missing, please send us a PR to add it!** Our aim is to have every example 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.

## The example programs

<details>
<summary>Basics</summary>

## Basics
### Hello world

[Hello World on Solana! A minimal program that logs a greeting.](./basics/hello-solana/README.md)
Expand Down Expand Up @@ -124,11 +119,7 @@ How to store state that changes size in Solana.
[Send SOL between two accounts.](./basics/transfer-sol/README.md)

[anchor](./basics/transfer-sol/anchor) [native](./basics/transfer-sol/native) [pinocchio](./basics/transfer-sol/pinocchio)

</details>
<details>
<summary>Tokens</summary>

## Tokens
### Creating tokens

[Create a token on Solana with a token symbol and icon.](./tokens/create-token/README.md)
Expand Down Expand Up @@ -170,13 +161,7 @@ Allow two users to swap digital assets with each other, each getting 100% of wha
[Create liquidity pools to allow trading of new digital assets and allows users that provide liquidity to be rewarded by creating an Automated Market Maker.](./tokens/token-swap/README.md)

[anchor](./tokens/token-swap/anchor)

</details>

<details>

<summary>Token Extensions</summary>

## Token Extensions
### Basics - create token mints, mint tokens, and transfer tokens with Token Extensions

Create token mints, mint tokens, and transfer tokens using Token Extensions.
Expand Down Expand Up @@ -254,12 +239,7 @@ 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)

</details>
<details>

<summary>Compression</summary>

## Compression
### Cnft-burn

Burn compressed NFTs.
Expand All @@ -277,19 +257,11 @@ Store Metaplex compressed NFTs inside a PDA.
Work with Metaplex compressed NFTs.

[anchor](./compression/cutils/anchor)

</details>

<details>

<summary>Oracles</summary>

## Oracles
### pyth

Use a data source for offchain data (called an Oracle) to perform activities onchain.

[anchor](./oracles/pyth/anchor)

</details>

---
Loading