Sol.College

Full lesson

seloongmun

Se Loong Mun

What it does

From the project README:

You can use any normal anchor commands. Either move to the `anchor` directory and run the `anchor` command or prefix the command with `npm run`, eg: `npm run anchor`.
Original
khtang-7777/seloongmun
SuperStack fork
Blockchains/seloongmun @ e314413
Stars
0
Last push (original)
2024-04-07
Languages
TypeScript, Rust, JavaScript, CSS
Detected stack
AnchorNext.jsweb3.js
Categories
Other
Licence
MIT

Architecture

34 source files. By extension: .tsx ×20, .ts ×9, .js ×4, .rs ×1.

Top-level directorySource files
web26
anchor6
(root)2

On-chain programs: anchor/programs/seloongmun

❌ Does not build as-is, checked 2026-11-02 Tested on 2026-11-02: full log results.json

Build it yourself: step-by-step guide

Every command below was run on 2026-11-02 by tests/run_fork.py against the pinned commit, and the results come from that run. The full output is in the committed log.

1. Prerequisites (versions we tested with)

cargo install --git https://github.com/coral-xyz/anchor avm --locked
avm install 0.29.0 && avm use 0.29.0
sh -c "$(curl -sSfL https://release.anza.xyz/stable/install)"

2. Clone at the tested commit

git clone https://github.com/Blockchains/seloongmun.git && cd seloongmun
git checkout e3144132664c173861bd8a3797eaaa34610cddad

3. Configure

No environment file is needed.

4. Install dependencies

DirectoryCommandResultTime
.npm install --no-audit --no-fund --legacy-peer-deps✅ pass12s
anchornpm install --no-audit --no-fund --legacy-peer-deps✅ pass2s
anchornpm install --no-audit --no-fund --legacy-peer-deps✅ pass0s

5. Build

DirectoryCommandResultTime
anchoranchor@0.29.0 build✅ pass68s
.npm run build❌ exit 121s
Output tail: npm run build
    |          ^
  4 | import { Program } from '@coral-xyz/anchor';
  5 | import { useConnection } from '@solana/wallet-adapter-react';
  6 | import { Cluster, Keypair, PublicKey } from '@solana/web3.js';
Error occurred while trying to run the build command
1

6. Test

DirectoryCommandResultTime
anchoranchor@0.29.0 test --skip-build --provider.cluster localnet --provider.wallet ~/.config/solana/id.json✅ pass8s

7. Deploy to a local validator

solana-test-validator --reset   # separate terminal
solana config set -ul && solana airdrop 100
anchor deploy --provider.cluster localnet
DirectoryCommandResultTime
anchorsolana airdrop 100 -u localhost >/dev/null; anchor@0.29.0 deploy --provider.cluster localnet --provider.wallet ~/.config/solana/id.json✅ pass5s

Proof: program IDs and transactions

Transaction signatures recorded on the local validator (1 shown). Local ledgers are thrown away after the run, so these work as receipts in the log and can't be looked up on an explorer:

Deploy to devnet (free)

solana config set --url devnet
solana airdrop 2   # or https://faucet.solana.com
anchor deploy --provider.cluster devnet   # native: solana program deploy target/deploy/<name>.so
# point the frontend RPC env var at https://api.devnet.solana.com

How it works

Every instruction handler in the program, with the accounts struct it validates. Each link points to the line at the pinned commit.

InstructionAccountsWhere
initializeInitializeanchor/programs/seloongmun/src/lib.rs:17
drawDrawanchor/programs/seloongmun/src/lib.rs:38

Extend it

  1. Add an integration test that runs the main flow end to end and asserts every account state change.
  2. Add a negative test: call each instruction with the wrong signer or account and check that it fails.
  3. Add an event (emit!) to each state-changing instruction and subscribe to it from the client.
  4. Replace any unchecked AccountInfo with typed accounts plus has_one/seeds constraints.
  5. Make the frontend read the cluster from an env var, deploy it to GitHub Pages and point it at your devnet program.
  6. Wire the build into CI by copying this site's verify-forks workflow.

Open the dapp

Deployed on devnet; the full in-browser flow is not yet proven end to end.

Open the dapp Connect Phantom or Solflare. Every transaction is signed in your own wallet.

Key code, explained

Excerpts chosen automatically where the code uses the most Solana concepts, pinned to the fork's commit.

khtang-7777/seloongmun · anchor/programs/seloongmun/src/lib.rs L97–119 @ e314413 · MIT · original
 #[derive(Accounts)]pub struct Initialize<'info> {    #[account(        init_if_needed,        payer = signer,        space = 8 + 9,        seeds = [b"safevault"],        bump,    )]    pub safe_vault: Account<'info, SafeVault>,    #[account(        init_if_needed,        payer = signer,        space = 8 + 11,        seeds = [b"seloongmun"],        bump,    )]    pub seloongmun: Account<'info, Seloongmun>,    #[account(mut)]    pub signer: Signer<'info>,    pub system_program: Program<'info, System>,}
  1. Line 101 init_if_needed,: Creates the account only if it doesn't exist. Watch for re-initialisation bugs.
  2. Line 104 seeds = [b"safevault"],: Declares the PDA seeds. Anchor re-derives the address and rejects the account if it doesn't match.
  3. Line 105 bump,: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve.
  4. Line 117 pub signer: Signer<'info>,: Requires this account to have signed the transaction.

How to run, build and test

These commands come from the repo's own manifests (package.json scripts, Anchor.toml, Cargo, go.mod, Makefile). Check the README for prerequisites and environment variables.

DirectoryCommandRuns
.npm run devnx serve web
.npm run buildnx build web
anchoranchor buildcompile programs and generate IDLs
anchoranchor testlocal validator + test suite
anchoranchor run test../node_modules/.bin/nx run anchor:jest

What you could build from it