Live Project Link: https://mint-my-deal.vercel.app/
MintMyDeals is a decentralized deal discovery and loyalty platform built on Solana where merchants create NFT-based coupons that users can mint, own, transfer, trade on our marketplace, or redeem at merchants.
- Overview
- Key Features
- Screenshots
- Demo Video
- Tech Stack
- Architecture
- Getting Started
- Project Structure
- Smart Contract
- Frontend Features
- Marketplace
- Usage Guide
- Contributing
- License
- Contact
MintMyDeals revolutionizes traditional loyalty programs by transforming coupons into transferable NFTs on the Solana blockchain. Unlike conventional platforms that lock deals to user accounts, our platform enables:
- ✅ True Ownership - NFTs you truly own in your wallet
- ✅ Peer-to-Peer Trading - Built-in marketplace for trading coupons
- ✅ Decentralized Storage - Metadata stored on Arweave via Irys
- ✅ Transparent & Verifiable - All transactions on-chain
- ✅ Merchant & User Friendly - Intuitive interfaces for both parties
- Easy Registration - Register on-chain with name and website
- Deal Creation - Create unlimited deals with:
- Custom discount percentages
- Supply limits (NFT quantity)
- Expiry dates and times
- NFT images and metadata
- Deal Management - View all created deals with stats
- Automatic NFT Template - Each deal becomes an NFT template users can mint
- Deal Discovery - Browse active and expired deals in tabbed interface
- One-Click Minting - Mint NFT coupons directly to wallet
- Wallet Integration - Automatic NFT detection and display
- Redemption - Burn NFT on-chain and receive:
- Transaction signature for verification
- 16-digit alphanumeric coupon code
- Works for both physical and online stores
- Marketplace - List or buy NFT coupons from other users
- Unified Smart Contract - All features in one Solana program
- Atomic Transaction Guards - Prevents duplicate submissions
- Automatic UI Updates - Real-time state synchronization
- Comprehensive Error Handling - User-friendly error messages
- Mobile Responsive - Works on all devices
Browse active and expired deals with our intuitive tab-based interface
Merchants can create unlimited deals with detailed configuration options
Create deals with images, discounts, supply limits, and expiry dates
View deal information, mint coupons, and read reviews
Browse and purchase NFT coupons from other users
View all your NFT coupons and redeem them with one click
Clear redemption confirmation with coupon code and transaction proof
- Solana - High-performance blockchain
- Anchor Framework - Rust-based Solana program framework
- SPL Token - Standard token program for NFTs
- Metaplex Token Metadata - NFT metadata standards
- Next.js 13+ - React framework with App Router
- TypeScript - Type-safe JavaScript
- Tailwind CSS - Utility-first CSS framework
- Solana Web3.js - Solana JavaScript library
- @solana/wallet-adapter - Wallet integration
- Irys (Arweave) - Decentralized permanent storage for NFT metadata and images
- Rust - Smart contract development
- Cargo - Rust package manager
- npm/yarn - JavaScript package manager
deal_platform/
├── Instructions
│ ├── Register Merchant
│ ├── Create Deal
│ ├── Verify & Count Mint
│ ├── Redeem & Burn NFT
│ ├── Add Review
│ ├── List NFT (Marketplace)
│ └── Buy NFT (Marketplace)
│
├── State Accounts
│ ├── Merchant (PDA)
│ ├── Deal (PDA)
│ ├── Review (PDA)
│ ├── Redeem Log (PDA)
│ └── Listing (PDA)
│
└── Escrow System
└── NFT Escrow Account (PDA)
frontend/
├── app/ # Next.js App Router
│ ├── page.tsx # Home/redirect
│ ├── deals/ # Deal discovery
│ ├── deals/[id] # Deal detail & minting
│ ├── merchant/ # Merchant dashboard
│ ├── redeem/ # NFT redemption
│ └── marketplace/ # NFT marketplace
│
├── lib/
│ ├── solana/ # Solana utilities
│ │ ├── instructions.ts # Contract instructions
│ │ └── errors.ts # Error handling
│ ├── umi/ # UMI (Metaplex) client
│ └── toast/ # Toast notifications
│
└── components/ # Reusable components
└── Loader.tsx # Loading skeletons
- Deal Creation: Merchant creates deal → Metadata uploaded to Irys → Deal account created on-chain
- NFT Minting: User mints NFT → Metaplex NFT created → Deal counter incremented
- Redemption: NFT burned → Redeem log created → Coupon code generated
- Marketplace: NFT transferred to escrow → Listing created → Buyer purchases → NFT transferred
- Node.js 18+ and npm/yarn
- Rust 1.70+ and Cargo
- Solana CLI (latest version)
- A Solana wallet (Phantom recommended)
-
Clone the repository
git clone https://github.com/yourusername/monke-nft.git cd monke-nft -
Install dependencies
# Frontend dependencies cd frontend npm install # Smart contract dependencies (already in contracts folder) cd ../contracts/programs/deal_platform cargo build-sbf
-
Set up environment variables
# In frontend directory, create .env.local NEXT_PUBLIC_PROGRAM_ID=your_program_id_here NEXT_PUBLIC_RPC_URL=https://api.devnet.solana.com -
Deploy smart contract (if needed)
# Build and deploy cd contracts/programs/deal_platform anchor build anchor deploy
-
Run the frontend
cd frontend npm run dev -
Open in browser
http://localhost:3000
monke-nft/
├── contracts/
│ ├── programs/
│ │ └── deal_platform/ # Solana smart contract
│ │ ├── src/
│ │ │ ├── lib.rs # Program entry point
│ │ │ ├── state.rs # Account structures
│ │ │ ├── instruction.rs # Instruction definitions
│ │ │ └── processor.rs # Instruction handlers
│ │ └── Cargo.toml
│ └── tests/ # Contract tests
│
├── frontend/
│ ├── app/ # Next.js pages
│ ├── components/ # React components
│ ├── lib/ # Utilities
│ ├── public/ # Static assets
│ └── package.json
│
├── screenshots/ # Screenshot images
│ ├── deals-discovery.png
│ ├── merchant-dashboard.png
│ └── ...
│
└── README.md # This file
DealPlatform Program (Your Program ID)
Creates a merchant account on-chain with name and website URI.
Creates a deal with title, description, discount percentage, total supply, expiry, and metadata URIs.
Verifies NFT mint and increments deal's minted counter. Prevents over-minting.
Burns the NFT and creates an immutable redemption log on-chain.
Lists NFT on marketplace by transferring to escrow and creating listing account.
Purchases NFT from marketplace by transferring SOL to seller and NFT to buyer.
All accounts use Program Derived Addresses (PDAs) for deterministic address generation:
- Merchant:
[merchant, merchant_pubkey] - Deal:
[deal, merchant_pubkey, deal_id] - Review:
[review, deal_pda, user_pubkey] - Redeem Log:
[redeem, nft_mint] - Listing:
[listing, nft_mint, seller_pubkey] - Escrow:
[escrow, nft_mint]
- Seamless Phantom wallet connection
- Automatic wallet detection
- Transaction signing with user approval
- Error handling for wallet rejections
- Atomic guards prevent duplicate submissions
- Real-time transaction status updates
- Automatic UI refresh after successful transactions
- Comprehensive error messages with Solana Explorer links
- Loading skeletons for better perceived performance
- Toast notifications for user feedback
- Responsive design for all screen sizes
- Intuitive navigation and clear CTAs
- Automatic NFT fetching from user wallet
- Metadata parsing and image display
- Deal information matching
- Empty state handling
- Simple price input interface
- Automatic escrow account creation
- NFT transferred to escrow on listing
- Listing visible on marketplace
- Fixed-price listings only
- Automatic buyer ATA creation if needed
- SOL transferred to seller
- NFT transferred from escrow to buyer
- Listing account closed after purchase
- Filters invalid listings (wrong size, invalid prices, zero addresses)
- Displays only active, valid listings
- Real-time listing updates
- Connect Wallet: Use Phantom or compatible Solana wallet
- Register: Navigate to
/merchantand register with name and website - Create Deal: Click "Create Deal" button, fill form:
- Upload NFT image
- Set discount percentage
- Set total supply
- Set expiry date/time
- View Deals: See all your created deals with stats
- Browse Deals: Visit
/dealsto see active deals - Mint NFT: Click on a deal, then click "Mint NFT Coupon"
- View NFTs: Go to
/redeemto see all your NFT coupons - Redeem: Click "Redeem" on an NFT to burn it and get coupon code
- Trade: Click "List NFT" to sell on marketplace, or browse
/marketplaceto buy
This project is licensed under the MIT License - see the LICENSE file for details.
Built with ❤️ on Solana
Last updated: 2024

