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 directory | Source files |
|---|---|
frontend | 17 |
programs | 4 |
tests | 1 |
migrations | 1 |
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.
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)]- 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. - Line 196
bump: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve. - Line 201
init,: Creates and pays for a new account. Space and payer must be specified. - Line 214
pub seller: Signer<'info>,: Requires this account to have signed the transaction. - Line 216
#[account(mut, has_one = seller)]: Checks that a stored pubkey field matches the passed account.
programs/goreda/src/escrow.rs L1–23 @ bda3778 · MIT · originaluse 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(())}- Line 9
from: &Signer<'info>,: Requires this account to have signed the transaction. - 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.
| Directory | Command | Runs |
|---|---|---|
. | npm run lint | prettier */*.js "*/**/*{.js,.ts}" --check |
frontend | npm run dev | next dev |
frontend | npm run start | next start |
frontend | npm run build | next build |
frontend | npm run lint | eslint |
. | anchor build | compile programs and generate IDLs |
. | anchor test | local validator + test suite |
. | anchor run test | yarn run ts-mocha -p ./tsconfig.json -t 1000000 \ |
. | cargo build | Rust workspace build |
. | cargo test | Rust tests |
What you could build from it
- Fork the SuperStack copy and extend it within the Other gaps listed on the idea page.
- Learn the pattern first: Program Derived Addresses (PDAs)
- Learn the pattern first: Cross-Program Invocations (CPIs)