Sol.College

Full lesson

DealMint

Turn discounts into liquid, ownable assets. Claim a perk, redeem via QR, or transfer in seconds.

What it does

From the project README:

Turn discounts into liquid, ownable assets. Claim a perk, redeem via QR, or transfer in seconds.
Original
N-45div/DealMint
SuperStack fork
Blockchains/DealMint @ c8b810b
Stars
0
Last push (original)
2025-10-30
Languages
TypeScript, CSS, JavaScript
Detected stack
MetaplexNext.jsSolana Payweb3.js
Categories
DeFi
Licence
MIT

Architecture

93 source files. By extension: .tsx ×50, .ts ×43.

Top-level directorySource files
src85
scripts3
(root)2
tests2
prisma1

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

N-45div/DealMint · src/app/api/nft/prepare-mint-signed/route.ts L37–60 @ c8b810b · MIT · original
    const serverTx = new Transaction()    serverTx.add(      SystemProgram.createAccount({        fromPubkey: feePayer.publicKey,        newAccountPubkey: mintKp.publicKey,        lamports: rent,        space: MINT_SIZE,        programId: TOKEN_PROGRAM_ID,      }),      createInitializeMintInstruction(mintKp.publicKey, 0, ownerPk, null, TOKEN_PROGRAM_ID),    )    serverTx.feePayer = feePayer.publicKey    serverTx.recentBlockhash = (await connection.getLatestBlockhash('finalized')).blockhash    await connection.sendTransaction(serverTx, [feePayer, mintKp], { skipPreflight: true })     // Build unsigned tx for owner: create ATA (payer=owner) + mintTo (mintAuthority=owner)    const ata = await getAssociatedTokenAddress(mintKp.publicKey, ownerPk)    const clientTx = new Transaction()    clientTx.feePayer = ownerPk    clientTx.recentBlockhash = (await connection.getLatestBlockhash('finalized')).blockhash    clientTx.add(      createAssociatedTokenAccountInstruction(ownerPk, ata, ownerPk, mintKp.publicKey),      createMintToInstruction(mintKp.publicKey, ata, ownerPk, 1),    )
  1. Line 49 serverTx.recentBlockhash = (await connection.getLatestBlockhash('finalized')).blockhash: Fetches a recent blockhash. Transactions expire if it gets too old.
  2. Line 50 await connection.sendTransaction(serverTx, [feePayer, mintKp], { skipPreflight: true }): Submits the signed transaction to the cluster.
  3. Line 59 createMintToInstruction(mintKp.publicKey, ata, ownerPk, 1),: Mints new tokens. The mint authority must sign.

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 devnext dev --turbopack
.npm run startnext start
.npm run buildnext build
.npm run lintnext lint

What you could build from it

Used in lessons