Sol.College

Full lesson

GoReda

What it does

From the project README:

The luxury goods market loses **$4.5 trillion annually** to counterfeits and fraud. Traditional platforms take 3-7 days for refunds, offer no verifiable shipping trail, and provide zero proof of authenticity.
Original
yyxcn/GoReda
SuperStack fork
Blockchains/GoReda @ bda3778
Stars
0
Last push (original)
2026-05-12
Languages
TypeScript, Rust, CSS, JavaScript
Detected stack
AnchorNext.jsweb3.js
Categories
Other
Licence
MIT
Homepage
https://go-reda.vercel.app

Architecture

23 source files. By extension: .tsx ×13, .ts ×6, .rs ×4.

Top-level directorySource files
frontend17
programs4
tests1
migrations1

On-chain programs: programs/goreda

Dapp: devnet deploy pending

⏳ Devnet deploy pending — goes live when the devnet wallet is topped up. This fork's own dapp is not deployed yet, so there is no program address or transaction to show. It is queued in dapp-queue.txt; once devnet SOL is available it is deployed, exercised with real devnet transactions, and this section switches to the live dapp at /dapps/goreda/. Until then, the lesson and step-by-step guide below are complete, and you can run it locally with the commands below.

Key code, explained

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

yyxcn/GoReda · programs/goreda/src/lib.rs L193–216 @ bda3778 · MIT · original
        payer = buyer,        space = Order::SPACE,        seeds = [b"order", buyer.key().as_ref(), product_id.to_le_bytes().as_ref()],        bump    )]    pub order: Account<'info, Order>,     #[account(        init,        payer = buyer,        space = EscrowAccount::SPACE,        seeds = [b"escrow", order.key().as_ref()],        bump    )]    pub escrow: Account<'info, EscrowAccount>,     pub system_program: Program<'info, System>,} #[derive(Accounts)]pub struct ConfirmOrder<'info> {    pub seller: Signer<'info>,     #[account(mut, has_one = seller)]
  1. Line 195 seeds = [b"order", buyer.key().as_ref(), product_id.to_le_bytes().as_ref()],: Declares the PDA seeds. Anchor re-derives the address and rejects the account if it doesn't match.
  2. Line 196 bump: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve.
  3. Line 201 init,: Creates and pays for a new account. Space and payer must be specified.
  4. Line 214 pub seller: Signer<'info>,: Requires this account to have signed the transaction.
  5. Line 216 #[account(mut, has_one = seller)]: Checks that a stored pubkey field matches the passed account.
yyxcn/GoReda · programs/goreda/src/escrow.rs L1–23 @ bda3778 · MIT · original
use anchor_lang::prelude::*;use anchor_lang::system_program; use crate::state::EscrowAccount; /// Transfer SOL from buyer (signer) to escrow PDA via system_program CPI./// This works because the buyer is a signer and system-owned.pub fn fund_escrow<'info>(    from: &Signer<'info>,    to_escrow: &Account<'info, EscrowAccount>,    system_program: &Program<'info, system_program::System>,    amount: u64,) -> Result<()> {    let cpi_ctx = CpiContext::new(        system_program.to_account_info(),        system_program::Transfer {            from: from.to_account_info(),            to: to_escrow.to_account_info(),        },    );    system_program::transfer(cpi_ctx, amount)?;    Ok(())}
  1. Line 9 from: &Signer<'info>,: Requires this account to have signed the transaction.
  2. Line 14 let cpi_ctx = CpiContext::new(: Makes a cross-program invocation into another program.

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 lintprettier */*.js "*/**/*{.js,.ts}" --check
frontendnpm run devnext dev
frontendnpm run startnext start
frontendnpm run buildnext build
frontendnpm run linteslint
.anchor buildcompile programs and generate IDLs
.anchor testlocal validator + test suite
.anchor run testyarn run ts-mocha -p ./tsconfig.json -t 1000000 \
.cargo buildRust workspace build
.cargo testRust tests

What you could build from it

Used in lessons