A thematic NFT marketplace for Yu-Gi-Oh! trading cards built on Ethereum with ERC721 standard. Users can discover, collect, and trade authentic Yu-Gi-Oh! cards as NFTs.
- 🎴 Yu-Gi-Oh! Theme: Dedicated marketplace for Yu-Gi-Oh! card NFTs
- 🔗 Wallet Integration: Connect MetaMask for full functionality
- 🛒 Buy & Sell: List NFTs for fixed prices and purchase with ETH
- 📱 Portfolio Management: View and manage your NFT collection
- 🔍 Advanced Filters: Filter by card type, attribute, rarity, and price
- ➕ Submit NFTs: Add existing ERC721 NFTs from any contract
Follow these steps to run the marketplace locally:
- Node.js (v16 or higher)
- MetaMask browser extension
-
Install dependencies
npm install
-
Start local blockchain
npx hardhat node
Keep this terminal running. The blockchain will be available at
http://127.0.0.1:8545 -
Deploy smart contracts (in a new terminal)
npm run deploy
-
Deploy sample NFTs
npm run samples
-
Start the API server (for NFT submissions)
npm run api
-
Launch the website
npm run serve
The website will be available at http://localhost:8080
After running npm run samples, the following Yu-Gi-Oh! NFTs will be available for testing:
- Blue-Eyes White Dragon - Token ID: 0 (Listed for 2.5 ETH)
- Dark Magician - Token ID: 1 (Listed for 1.8 ETH)
- Red-Eyes Black Dragon - Token ID: 2 (Listed for 2.0 ETH)
- Exodia the Forbidden One - Token ID: 3 (Listed for 5.0 ETH)
- Kuriboh - Token ID: 4 (Not listed)
- Neo the Magic Swordsman - Token ID: 0 (Not listed)
- Baron of the Fiend Sword - Token ID: 1 (Not listed)
- Man-Eating Treasure Chest - Token ID: 2 (Not listed)
- Gemini Elf - Token ID: 3 (Not listed)
- 4-Starred Ladybug of Doom - Token ID: 4 (Not listed)
- 7 Colored Fish - Token ID: 5 (Not listed)
- Click "Connect Wallet" on the homepage
- Connect MetaMask to the local network (Localhost 8545)
- Import test accounts if needed
- Visit the "Explore" page to see all available NFTs
- Use filters to find specific card types or attributes
- Click on any NFT to view details
- Go to "Add Your NFT" page
- Enter a contract address and token ID (use the sample NFTs above)
- Example: Contract
0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0, Token ID0 - Preview and submit the NFT
- After connecting wallet, visit "Portfolio" page
- View all NFTs you own
- List NFTs for sale using the shopping cart icon
- To buy: Click "Buy Now" on any listed NFT
- To sell: Go to Portfolio → Click shopping cart icon → Set price
- Test with different accounts to simulate real trading
nft-marketplace/
├── contracts/ # Solidity smart contracts
├── scripts/ # Deployment and seeding scripts
├── frontend/ # React frontend application
├── api-server/ # Backend API for NFT submission
└── test/ # Smart contract tests
- YugiohNFT: Main NFT contract with Yu-Gi-Oh! specific metadata
- YugiohMarketplace: Marketplace contract for buying/selling
- SimpleNFT: Additional contract for external NFT testing
# Blockchain
npm run node # Start local blockchain
npm run deploy # Deploy main contracts (YugiohNFT + Marketplace)
npm run deploy-simple # Deploy SimpleNFT contract (for testing)
npm run samples # Deploy sample Yu-Gi-Oh NFTs
npm run samples-simple # Deploy sample SimpleNFTs
npm run accounts # Show test accounts
# API Server
npm run api # Start API server (required for NFT submissions)
npm run api-dev # Start API server in development mode
# Frontend
npm run serve # Start frontend (localhost:8080)
# Quick Setup
npm run setup # Deploy + seed main contracts
npm run setup-simple # Deploy + seed SimpleNFT contract
# Testing
npm run test # Run smart contract tests
npm run verify # Verify deployment
npm run verify-audit # Verify audit setup requirementsFor testing external NFT submissions, you can deploy SimpleNFT:
# Deploy SimpleNFT contract
npm run deploy-simple
# Mint 6 sample SimpleNFTs with Yu-Gi-Oh data
npm run samples-simple
# Or do both at once
npm run setup-simpleThis creates 6 additional NFTs perfect for testing the Submit NFT feature!
-
Add Local Network:
- Network Name: Hardhat Local
- RPC URL: http://127.0.0.1:8545
- Chain ID: 31337
- Currency Symbol: ETH
-
Import Test Accounts (from
npx hardhat nodeoutput):- Use private keys shown in terminal
- Each account has 10,000 ETH for testing
Port 8080 already in use?
# Kill any process using port 8080
sudo lsof -ti:8080 | xargs kill -9MetaMask connection issues?
- Reset MetaMask account (Settings → Advanced → Reset Account)
- Ensure you're on the correct network (Localhost 8545)
NFTs not loading?
- Check that blockchain is running (
npx hardhat node) - Verify contracts are deployed (
npm run deploy) - Refresh the page after wallet connection
MIT License