CoffeeSwap: Trade convenience store coffees securely on a peer-to-peer blockchain platform.
CoffeeSwap is a decentralized platform built on World Chain that enables users to trade convenience store coffees with each other. Using smart contracts and a token-based escrow system, users can post coffees they have (like a 7-Eleven Americano) and specify what they're willing to accept in return (such as a Family Mart Latte). The app matches users based on their preferences, facilitates secure transactions through our public account system, and provides verification using phone number digits. Our unique CST token powers the platform, with a 20 CST deposit requirement and bonus rewards for quick transfers. This eliminates coffee waste while creating a fun, community-driven marketplace for coffee enthusiasts.
CoffeeSwap is built as a World mini app using the MiniKit SDK, allowing us to leverage World App's wallet capabilities and user base. The frontend is developed with Next.js, TypeScript, and Tailwind CSS, creating a mobile-optimized interface that works seamlessly within World App. For the backend, we deployed two Solidity smart contracts on World Chain: the CoffeeSwapToken (CST) contract handles our platform token with custom minting and transaction functions, while the main CoffeeSwap contract manages posts, transaction matching, and verification logic. We implemented a deposit-based escrow system (20 CST) to ensure transaction safety, with a 0.5 CST reward for the first transferrer. The integration between our frontend and smart contracts is handled through a custom contractService layer that uses ethers.js for read operations and MiniKit's transaction capabilities for write operations. One particularly clever implementation is our phone number verification system - users verify coffee transfers by submitting just the last three digits of their phone number, providing a simple yet effective confirmation mechanism that bridges the physical and digital aspects of the exchange.