A full-stack Web3 NFT auction system built on Ethereum (Sepolia), featuring an upgradeable smart contract architecture and a production-style off-chain indexing backend.
This project demonstrates an end-to-end pipeline:
On-chain contract → Event indexing → Structured storage → Queryable API
The system consists of two major components:
- NFT Auction Market (UUPS Upgradeable)
- Supports ETH and ERC20 (USDC) bidding
- Chainlink Price Feeds for fair USD-based comparison
- Real-time blockchain event indexing
- Persistent storage in MySQL
- REST API for frontend consumption
- UUPS upgradeable architecture (ERC1967 standard)
- Dual-token bidding (ETH + USDC)
- Chainlink Oracle integration (ETH/USD, USDC/USD)
- Unified USD-based bid comparison
- Full auction lifecycle:
- Create auction
- Place bid
- End auction
- Settlement
- Event-driven indexer (based on go-ethereum)
- Automatic chain synchronization with cursor tracking
- Resumable indexing (fault-tolerant)
- REST API abstraction for frontend
- Clean separation of domain logic and infrastructure
- Implemented UUPS proxy pattern
- Ensured storage layout compatibility across versions
- Verified upgrade safety via V1 → V2 migration
- Integrated Chainlink Price Feeds
- Converted all bids into USD (18 decimals)
- Eliminated unfair advantages across token types
- Subscribed to contract events:
- AuctionCreated
- BidPlaced
- AuctionEnded
- AuctionCancelled
- Parsed logs into structured domain models
- Stored into relational database
- Maintained sync_cursors table
- Enabled restart-safe indexing
- Supports backfilling historical blocks
Frontend interacts with backend without touching blockchain:
- /api/auctions
- /api/auctions/:id
- /api/auctions/:id/bids
- /api/stats
nft-auction-protocol/ ├── onchain/ # Smart contracts (Hardhat) ├── backend/ # Indexer + API (Go)
contracts/ ├── MyNFT.sol ├── NFTAuctionMarketUUPS_V1.sol ├── NFTAuctionMarketUUPS_V2.sol
cmd/server # Entry point internal/indexer # Chain event processing internal/api # HTTP handlers internal/infra/db # DB models & repository layer internal/config # Configuration
- Solidity
- Hardhat
- OpenZeppelin (UUPSUpgradeable)
- Chainlink Oracle
- Go
- Gin
- GORM
- MySQL
- go-ethereum
- Docker Compose
Proxy (Auction): 0x085Ab5880dff3EDaE319948946E1df5bF683934e
V2 Implementation: 0x6E5F7Ba248F6deaC57ba0cfB565C0c7f24240f94
MyNFT: 0x7613Fea95c816346beaBE7132A29BC4Ab14BE83b
Covers:
- Auction creation
- ETH vs USDC bidding logic
- Price comparison via oracle
- Auction settlement
- Upgradeability validation
Run: npx hardhat test
Validated full workflow:
- Deploy NFT contract
- Mint NFT
- Approve marketplace
- Create auction
- Multi-round bidding
- Oracle price verification
- Auction settlement
- Contract upgrade (V1 → V2)
docker-compose up
or
go run cmd/server/main.go
GET /health
GET /api/stats
GET /api/auctions
GET /api/auctions/:id
GET /api/auctions/:id/bids
See /screenshots folder.
This project was built to explore the trade-offs between on-chain execution and off-chain indexing.
Key considerations include:
- Reducing RPC dependency via event-driven indexing
- Ensuring upgrade safety with UUPS proxy pattern
- Handling multi-token bidding with consistent price normalization
The goal was to simulate a production-like architecture while keeping the system minimal and testable.
- Production-style smart contract architecture
- Upgradeable protocol design
- Cross-token economic logic (USD normalization)
- Event-driven backend system
- End-to-end Web3 system integration
- WebSocket real-time updates
- Frontend integration (React / Next.js)
- Multi-chain support
- Advanced auction types (Dutch, sealed-bid)
M.X Du
Smart Contract Engineer (EVM)
Focused on protocol design, upgradeability, and backend indexing systems.