Web3 On-chain Red Packet DApp

This is a 100% decentralized blockchain red packet application. Users can connect their wallets, set an amount and quantity to send red packets, and then share a link for others to claim. All data and operations are based on the blockchain, completely eliminating the need for centralized servers, making the entire process secure, transparent, and traceable. If you’re interested, you can check out my code on GitHub: redpacket‑dapp Feature Highlights 🧧 Send Red Packet: Connect your wallet, set the amount and quantity, and send a red packet to the blockchain. 🎁 Claim Red Packet: Through a shared link, others can connect their wallets and claim the red packet directly from the blockchain. 🔗 Smart Contract: Secure smart contracts written in Solidity handle all logic. 🌐 Multi-chain Support: Supports local testnet and BSC testnet. 💼 Web3 Integration: Uses MetaMask wallet connection. 🚀 Fully Decentralized: No backend server, all data stored on the blockchain. Tech Stack Frontend: React 19, React Router 6, TypeScript, Vite, Ethers v6 Contract Layer: Hardhat, Solidity 0.8.x Tools: ESLint, Prettier No Backend Required: Zero server dependencies ❌ Quick Start # 1. Install project dependencies npm install cd react-dapp && npm install && cd .. # 2. Start local blockchain node npm run node # 3. Compile smart contracts npx hardhat compile # 4. Deploy smart contracts npm run deploy # 5. Start frontend npm run frontend Directory Structure redpacket-web3/ ├─ contracts/ # Solidity smart contracts │ └─ RedPacket.sol ├─ react-dapp/ # React + Vite frontend │ ├─ src/ │ │ ├─ components/ # Common components (wallet button, create form, etc.) │ │ ├─ config/ # ABI, contract address configuration │ │ ├─ hooks/ # Custom hooks (useWallet) │ │ ├─ pages/ # Pages (Home, ClaimPacket) │ │ ├─ styles/ # Global styles │ │ ├─ utils/ # Web3 utility functions │ │ └─ App.tsx # Routing and layout │ ├─ .env.example # Frontend environment variable instructions │ └─ package.json ├─ scripts/ │ └─ deploy.js # Hardhat deployment script (automatically writes to frontend config) ├─ hardhat.config.js └─ package.json # Root scripts (Hardhat + frontend one-click start) Usage Guide Create a Red Packet Open the frontend and click “Connect Wallet” in the top right corner. Fill in the total red packet amount and number of shares; the application will randomly split the amount on the frontend. Submit and confirm the transaction in MetaMask, then wait for block confirmation. Upon success, copy the system-generated claim link and share it with friends. Claim a Red Packet Open the shared link (URL contains /claim/{packetId}). Connect your wallet first, then click “Claim”. After signing and confirming, wait for the block to be mined. The page will display the result and remaining shares. Environment Variables dapp/.env (automatically ignored in development, please refer to .env.example) VITE_RPC_URL: Frontend direct RPC node, defaults to http://127.0.0.1:8545 VITE_CONTRACT_ADDRESS: Can override the address written by the deployment script VITE_CHAIN_ID: Chain ID (hexadecimal) prompted for use by the frontend root/.env: If you need to reference private keys or BSC RPC in Hardhat, you can continue to use the original syntax. Smart Contract (RedPacket.sol) Core methods: ...

January 10, 2026 · 4 min · MoeJue

I don’t know AE, but I can code

✨ Oyama まひろの小屋 ✨ 🌸 Welcome to Oyama まひろの小屋 🌸 Wow! You discovered my secret base! (*≧ω≦) This is Oyama Misaki’s personal website, full of cute animations and interesting content! I will share my favorite animations, comics, games and some small blessings in daily life here~ 💕 About Me 💕 My name is Oyama Ouyuki, and I love you and I love you. I like anime, comics, light novels and all kinds of cute things! Favorite colors are pink and light blue! ...

August 23, 2025 · 2 min · MoeJue

Multi-chain support is not as simple as you think

A practical reflection on multi-chain wallet integration Finally, I have some free time to sort out the code. The Web3 project has access to multi-chain wallet connection functions, mainly involving Ethereum, Polygon, BSC and Solana. At first glance, it seemed like it was just a matter of “doing a few more sets of compatible logic”, but after I actually implemented it, I discovered that many things were actually not as simple as I thought. ...

July 5, 2025 · 15 min · MoeJue

Build macOS-style web apps

Project Overview In today’s world of web development, user experience and interface design are becoming increasingly important. Mac Web Vue Template This is a modern and elegant Vue.js Web template inspired by macOS design. It is a modern web application template based on Vue.js. Its design is inspired by the elegant interface of macOS. This project not only provides beautiful UI design, but also includes complete project structure and best practices. ...

May 11, 2025 · 2 min · MoeJue

Mengyin Mall mobile version is on sale

Project introduction The mobile version of Mengyin Mall is a multi-terminal mall system developed based on uniapp, supporting multiple platforms such as iOS, Android, H5 and small programs. The system uses PHP + MySQL + FastAdmin as the back-end technology stack to achieve complete e-commerce functions. Core functions Product management: classification, list, detail display Shopping process: shopping cart, settlement, payment, order management User system: member center, personal information management -Multi-merchant model: merchants manage products and orders independently Shipping system: supports pushing orders to ERP (Guan Jia Po) system for processing Dual mode trading: Online ordering and express delivery Order online and pick up in store/delivery by rider System preview Backend management interface ...

April 17, 2025 · 2 min · MoeJue

An open source, simple and beautiful Kugou third-party client V1.0.0 Beta

MoeKoe Music An open source, simple and beautiful Kugou third-party client 🌎 GitHub repository | 📦️ Download the installation package | 💬 Visit the blog Preface As early as around 10 years ago, when I was using the web version of QQ, I had already started using Kugou Music (and I have been a fan for more than ten years), so all the songs I have collected over the years are on it. Later, I also tried to use NetEase Cloud or QQ Music, and also tried to import Kugou’s playlist, but the results were not satisfactory. Most of the songs I listened to were Japanese comic OPs, and many songs could not be found. ...

November 3, 2024 · 6 min · MoeJue

Multi-platform article synchronization browser plug-in - ArticleSync

ArticleSync - Multi-platform article synchronization plug-in ArticleSync is a browser extension that helps users easily publish articles to multiple social platforms simultaneously. Supports publishing articles from local drafts to major platforms, such as Zhihu, Bilibili, etc. It provides a one-stop solution that makes synchronizing your articles on different social media platforms simple and efficient. Based on the browser plug-in mode, it automatically detects local login accounts and eliminates risks such as account leaks and environmental abnormalities. ...

October 16, 2024 · 5 min · MoeJue

I won the Easter match and I came back to life

Recent situation It’s been more than two months since I last chatted, and it’s time to sort out my thoughts. Last time, I posted a bunch of emotions and then went silent, so it was a little rushed, and I couldn’t keep up with the follow-up work. It’s National Day again, and sure enough, my National Day is comparable to Double Eleven. Although the three domain names (52ecy.cn, moeins.cn, moeins.com) I owned before, although I won the resurrection competition, the equipment is gone. ...

October 3, 2024 · 4 min · MoeJue

Rebirth of I want to be a mall - Moony Mall V1.0 is online!

The N+1th project in the Moe Sound series is here. This is another project that’s been in the works for a few years now, but this time I’m finally able to fill in the gaps. First, the project address: https://MoeKoe.cn Why do I keep doing projects? This question is very interesting, why have been doing all kinds of projects, and still do not earn money things. Contact with some of my previous project partners know that I develop any project is in line with the principle of their own use in the creation, of course, this time is no exception. I’ve always wanted to sell my gadgets that I don’t want to throw away, and to share interesting products (and possibly my own IP products in the future) on a platform. “I want to share the most beautiful things to the most beautiful you” Even if, in line with the principle of “I have to have what others have”, I also have to have. ...

October 2, 2024 · 8 min · MoeJue

Blockchain image upload based on Web3.0

Before we start, let’s briefly understand the basic concepts. I can roughly summarize them into the following points What is Web3.0 and what does it have to do with blockchain? (The article last time will come in handy) Requirements: Develop a Python-based Web 3.0 image uploading system. This system will allow users to upload images and store them on a decentralized network, while recording transaction information on the blockchain. I originally wrote it for fun, but I thought about writing it into a user authentication file operation that integrates a full set of management, so that it “will eventually become the ultimate solution for image upload services.” But in practice, I found that it was not very practical, so I gave up. However, I have always been so obsessed with pictures. ...

June 17, 2024 · 5 min · MoeJue