Sol.College

Full lesson

Circuit-

Circuit is a made-to-order fashion brand , with Solana blockchain infrastructure; where garments are only produced after demand is confirmed. Buyers pay into on-chain escrow, garments are minted as NFTs at production, and resale royalties plus verifiable provenance are enforced by smart contracts.

What it does

From the project README:

Circuit is a premier made-to-order fashion platform powered by Solana. We redefine the fashion supply chain by producing garments only after demand is confirmed on-chain.
Original
circuit-sol/Circuit-
SuperStack fork
Blockchains/Circuit- @ 3004e0f
Stars
1
Last push (original)
2026-10-25
Languages
TypeScript, JavaScript, CSS, PLpgSQL, HTML, Rust
Detected stack
AnchorMetaplexNext.jsweb3.js
Categories
PaymentsNFTs & Digital Assets
Licence
MIT
Homepage
https://circuit-one.vercel.app

Architecture

60 source files. By extension: .tsx ×24, .js ×21, .ts ×12, .rs ×3.

Top-level directorySource files
app32
backend17
programs3
scripts2
tests2
(root)1
_old1
vertical1

On-chain programs: programs/circuit-drops, programs/circuit-escrow

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/circuit-/. 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.

circuit-sol/Circuit- · programs/circuit-escrow/src/lib.rs L361–384 @ 3004e0f · MIT · original
    pub quote_expires_at: i64,} #[derive(Accounts)]pub struct InitializeVault<'info> {    #[account(mut)]    pub payer: Signer<'info>,    #[account(seeds = [b"circuit-config"], bump = config.bump,        seeds::program = circuit_drops::ID,        constraint = config.version == POLICY_VERSION @ EscrowError::UnsupportedPolicy)]    pub config: Account<'info, CircuitConfig>,    #[account(seeds = [b"batch", batch.batch_id.as_ref()], bump = batch.bump,        seeds::program = circuit_drops::ID,        has_one = config @ EscrowError::WrongConfig)]    pub batch: Account<'info, BatchAccount>,    #[account(init, payer = payer, space = 8 + BatchVault::INIT_SPACE,        seeds = [b"batch-vault", batch.key().as_ref()], bump)]    pub vault: Account<'info, BatchVault>,    pub system_program: Program<'info, System>,} #[derive(Accounts)]#[instruction(args: PurchaseArgs)]pub struct Purchase<'info> {
  1. Line 367 pub payer: Signer<'info>,: Requires this account to have signed the transaction.
  2. Line 368 #[account(seeds = [b"circuit-config"], bump = config.bump,: Declares the PDA seeds. Anchor re-derives the address and rejects the account if it doesn't match.
  3. Line 368 #[account(seeds = [b"circuit-config"], bump = config.bump,: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve.
  4. Line 374 has_one = config @ EscrowError::WrongConfig)]: Checks that a stored pubkey field matches the passed account.
  5. Line 376 #[account(init, payer = payer, space = 8 + BatchVault::INIT_SPACE,: Creates and pays for a new account. Space and payer must be specified.
circuit-sol/Circuit- · programs/circuit-drops/src/lib.rs L133–156 @ 3004e0f · MIT · original
    pub program: Program<'info, CircuitDrops>,    #[account(        constraint = program_data.upgrade_authority_address == Some(upgrade_authority.key())            @ DropsError::UnauthorizedUpgradeAuthority    )]    pub program_data: Account<'info, ProgramData>,    #[account(init, payer = upgrade_authority, space = 8 + CircuitConfig::INIT_SPACE,        seeds = [b"circuit-config"], bump)]    pub config: Account<'info, CircuitConfig>,    pub system_program: Program<'info, System>,} #[derive(Accounts)]pub struct SetPlatformAuthority<'info> {    pub admin_authority: Signer<'info>,    pub new_platform_authority: Signer<'info>,    #[account(mut, seeds = [b"circuit-config"], bump = config.bump,        has_one = admin_authority @ DropsError::UnauthorizedAdmin,        constraint = config.version == POLICY_VERSION @ DropsError::UnsupportedPolicy)]    pub config: Account<'info, CircuitConfig>,} #[derive(Accounts)]pub struct TransferAdminAuthority<'info> {
  1. Line 139 #[account(init, payer = upgrade_authority, space = 8 + CircuitConfig::INIT_SPACE,: Creates and pays for a new account. Space and payer must be specified.
  2. Line 140 seeds = [b"circuit-config"], bump)]: Declares the PDA seeds. Anchor re-derives the address and rejects the account if it doesn't match.
  3. Line 140 seeds = [b"circuit-config"], bump)]: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve.
  4. Line 147 pub admin_authority: Signer<'info>,: Requires this account to have signed the transaction.
  5. Line 150 has_one = admin_authority @ DropsError::UnauthorizedAdmin,: Checks that a stored pubkey field matches the passed account.
circuit-sol/Circuit- · scripts/create-drop.ts L37–59 @ 3004e0f · MIT · original
        { name: "drop_id",       type: "string" },        { name: "active",        type: "bool"   },        { name: "bump",          type: "u8"     },      ],    },  }],  errors: [],}; async function main() {  const keypairPath = path.join(os.homedir(), ".config", "solana", "id.json");  const secretKey   = Uint8Array.from(JSON.parse(fs.readFileSync(keypairPath, "utf-8")));   const connection = new Connection(clusterApiUrl("devnet"), "confirmed");  const wallet     = new anchor.Wallet(anchor.web3.Keypair.fromSecretKey(secretKey));  const provider   = new anchor.AnchorProvider(connection, wallet, { commitment: "confirmed" });   const program = new anchor.Program(IDL as anchor.Idl, provider);   const [dropPda] = PublicKey.findProgramAddressSync(    [Buffer.from("drop"), Buffer.from(DROP_ID)],    PROGRAM_ID  );
  1. Line 39 { name: "bump", type: "u8" },: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve.
  2. Line 56 const [dropPda] = PublicKey.findProgramAddressSync(: Derives a PDA from seeds and the program ID and returns the address with its canonical bump.

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
backendnpm run devnode --watch src/server.js
backendnpm run startnode src/server.js
appnpm run devnext dev
appnpm run startnext start
appnpm run buildnext build
appnpm run linteslint
tests/escrownpm run testnode escrow-litesvm.cjs
.anchor buildcompile programs and generate IDLs
.anchor testlocal validator + test suite
.anchor run testnode scripts/test-batch-initialization.cjs
.cargo buildRust workspace build
.cargo testRust tests

What you could build from it

Used in lessons