[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-76136":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":14,"stars30d":15,"stars90d":14,"forks30d":14,"starsTrendScore":14,"compositeScore":16,"rankGlobal":10,"rankLanguage":10,"license":10,"archived":17,"fork":17,"defaultBranch":18,"hasWiki":19,"hasPages":17,"topics":20,"createdAt":10,"pushedAt":10,"updatedAt":41,"readmeContent":42,"aiSummary":43,"trendingCount":14,"starSnapshotCount":14,"syncStatus":44,"lastSyncTime":45,"discoverSource":46},76136,"Prediction-Market-Web3","Sealva-Devs\u002FPrediction-Market-Web3","Sealva-Devs","Production-ready crypto prediction market platform with secure smart contracts and modern React frontend. Features peer-to-peer wagering, multi-sig escrow, automatic payouts, and comprehensive security measures. Built with Solidity, Hardhat, React, and wagmi\u002Fviem.","https:\u002F\u002Fkurokagex.io",null,"TypeScript",47,1,0,37,0.9,false,"main",true,[21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],"betting","crypto","decentralized","defi","escrow","ethereum","evm","hardhat","multi-sig","openzeppelin","oracle","p2p","polymarket","prediction-market","react","smart-contract","solidity","typescript","wagmi","web3","2026-06-12 02:03:40","# Crypto Prediction Market — Production-Ready EVM Prediction Market Platform\n\nA **production-ready** **EVM prediction market** platform built with a **secure prediction market contract** (Solidity) and **modern prediction market frontend** (React). Features peer-to-peer wagering, multi-sig escrow, automatic payouts, and comprehensive security measures.\n\n**Status**: ✅ **Production Ready** — All functions tested, security hardened, and fully optimized.\n\n---\n\n## What Is This Platform?\n\nA **fully functional prediction market** on EVM chains featuring peer-to-peer wagering, multi-sig escrow, automatic payouts, and dispute resolution. This platform includes a **production-ready smart contract** with comprehensive security measures and a **modern, responsive frontend**.\n\n### Core Components\n\n- **Smart Contract**: Solidity 0.8.20, Hardhat — Secure, audited-ready **EVM prediction market contract**\n- **Frontend**: React + TypeScript, Vite, Material-UI, wagmi\u002Fviem — Modern, responsive UI\n- **Wallet Support**: MetaMask & WalletConnect integration\n- **Network**: Polygon Amoy (testnet) — Ready for mainnet deployment\n\n---\n\n## Features\n\n### Core Functionality\n- ✅ **Create Wagers** — Set up prediction markets with custom terms\n- ✅ **Pledge Funds** — Join wagers with minimum pledge requirements\n- ✅ **Multi-Sig Escrow** — Secure fund holding with participant signatures\n- ✅ **Resolve Wagers** — Declare winners with explicit selection\n- ✅ **Auto Payout** — Automatic fund release when all participants sign\n- ✅ **Manual Release** — Release funds after deadline passes\n- ✅ **Cancel Wagers** — Creator can cancel with automatic refunds\n- ✅ **Dispute Resolution** — Submit disputes to Polymarket (ready for integration)\n\n### Security Features\n- ✅ **Reentrancy Protection** — All critical functions protected\n- ✅ **Access Control** — Creator and owner-only functions\n- ✅ **Input Validation** — Comprehensive validation on all inputs\n- ✅ **Safe External Calls** — Proper state updates before transfers\n- ✅ **Emergency Withdraw** — Owner can recover funds if needed\n\n### User Experience\n- ✅ **Responsive UI** — Works on desktop and mobile\n- ✅ **Real-time Updates** — Live transaction status\n- ✅ **Transaction Tracking** — Explorer links for all transactions\n- ✅ **Error Handling** — User-friendly error messages\n- ✅ **Loading States** — Clear feedback during operations\n\n---\n\n## Project Structure\n\n```\nCrypto-Prediction-Market\u002F\n├── contracts\u002F              # Smart contract (Solidity, Hardhat)\n│   ├── contracts\u002F         # WagerContract.sol (main contract)\n│   ├── test\u002F              # Comprehensive test suite\n│   ├── scripts\u002F           # Deployment scripts\n│   └── abi\u002F               # Contract ABIs\n├── frontend\u002F              # React frontend application\n│   ├── src\u002F\n│   │   ├── components\u002F    # Reusable UI components\n│   │   ├── hooks\u002F         # Custom React hooks\n│   │   ├── pages\u002F         # Page components\n│   │   ├── config\u002F        # Configuration files\n│   │   └── utils\u002F         # Utility functions\n│   └── public\u002F            # Static assets\n└── README.md              # This file\n```\n\n---\n\n## Quick Start\n\n### Prerequisites\n\n- Node.js 18+ and npm\n- MetaMask browser extension (or compatible wallet)\n- Polygon Amoy testnet MATIC (for testing)\n\n### Installation\n\n1. **Clone the repository**\n   ```bash\n   git clone \u003Crepository-url>\n   cd Crypto-Prediction-Market\n   ```\n\n2. **Install Frontend Dependencies**\n   ```bash\n   cd frontend\n   npm install\n   ```\n\n3. **Install Contract Dependencies**\n   ```bash\n   cd ..\u002Fcontracts\n   npm install\n   ```\n\n### Running the Frontend\n\n```bash\ncd frontend\nnpm run dev\n```\n\nThe frontend will start on `http:\u002F\u002Flocalhost:5173` (or your configured port).\n\n**Environment Variables** (create `.env` in `frontend\u002F`):\n```env\nVITE_WAGER_CONTRACT_ADDRESS=0x...  # Deployed contract address\nVITE_WALLETCONNECT_PROJECT_ID=...  # Optional: WalletConnect project ID\n```\n\n### Deploying the Contract\n\n1. **Configure Network** (in `contracts\u002Fhardhat.config.js`):\n   - Add your private key to `.env`\n   - Configure network settings\n\n2. **Deploy to Polygon Amoy**:\n   ```bash\n   cd contracts\n   npm run deploy:amoy\n   ```\n\n3. **Deploy to Polygon Mainnet**:\n   ```bash\n   npm run deploy:polygon\n   ```\n\n### Running Tests\n\n```bash\ncd contracts\nnpm test\n```\n\nAll tests should pass (19\u002F19).\n\n---\n\n## Tech Stack\n\n### Frontend\n- **Framework**: React 18 + TypeScript\n- **Build Tool**: Vite 7\n- **UI Library**: Material-UI (MUI) 5\n- **Web3**: wagmi 2 + viem 2\n- **State Management**: Zustand\n- **Routing**: React Router 6\n- **Styling**: Emotion (CSS-in-JS)\n\n### Smart Contract\n- **Language**: Solidity 0.8.20\n- **Framework**: Hardhat 2\n- **Security**: OpenZeppelin Contracts 5\n- **Testing**: Hardhat + Chai\n- **Network**: Polygon Amoy (testnet) \u002F Polygon (mainnet)\n\n### Development Tools\n- **Linting**: ESLint\n- **Type Checking**: TypeScript\n- **Package Manager**: npm\n\n---\n\n## Project Status\n\n### ✅ Production Ready\n\n**Smart Contract**:\n- ✅ All 13 functions implemented and tested\n- ✅ Security hardened (reentrancy protection, access control)\n- ✅ Comprehensive test suite (19\u002F19 tests passing)\n- ✅ NatSpec documentation added\n- ✅ Gas optimized\n- ✅ Ready for audit\n\n**Frontend**:\n- ✅ All contract functions accessible from UI\n- ✅ Complete user flows (create, pledge, resolve, release, cancel)\n- ✅ Real-time transaction tracking\n- ✅ Error handling and validation\n- ✅ Responsive design\n- ✅ Wallet integration (MetaMask + WalletConnect)\n\n**Security**:\n- ✅ Reentrancy protection on all critical functions\n- ✅ Proper access control (creator\u002Fowner checks)\n- ✅ Input validation throughout\n- ✅ Safe external calls with state updates\n- ✅ Emergency withdrawal mechanism\n\n### Recent Improvements\n\n- 🔒 **Security**: Added reentrancy protection to `cancelWager()` and `signMultiSig()`\n- 🎯 **UX**: Added explicit winner selection dropdown\n- ⏰ **Accuracy**: Fixed multi-sig deadline calculation\n- 🎨 **Features**: Added cancel wager and release funds UI buttons\n- 📝 **Documentation**: Added NatSpec comments to all contract functions\n- ⚡ **Optimization**: Removed duplicate code, improved gas efficiency\n\n---\n\n## Smart Contract Functions\n\n### Core Functions\n- `createWager()` - Create a new prediction market wager\n- `pledge()` - Pledge funds to join a wager\n- `resolveWager()` - Resolve wager and set winner (creator\u002Fowner only)\n- `signMultiSig()` - Sign multi-sig to approve fund release\n- `releaseFunds()` - Release funds to winner (after deadline or all signed)\n- `cancelWager()` - Cancel wager and refund participants (creator\u002Fowner only)\n\n### View Functions\n- `getWager()` - Get complete wager details\n- `getParticipants()` - Get all participants for a wager\n- `getUserWagers()` - Get all wagers for a user\n- `hasSigned()` - Check if user has signed multi-sig\n- `getWagerCount()` - Get total number of wagers\n\n### Admin Functions\n- `emergencyWithdraw()` - Emergency fund recovery (owner only)\n\n## Development\n\n### Contract Scripts\n\n```bash\n# Compile contracts\nnpm run compile\n\n# Run tests\nnpm test\n\n# Deploy to Polygon Amoy\nnpm run deploy:amoy\n\n# Deploy to Polygon Mainnet\nnpm run deploy:polygon\n\n# Export ABI\nnpm run export-abi\n\n# Verify contract on explorer\nnpm run verify:amoy \u003CCONTRACT_ADDRESS>\n```\n\n### Frontend Scripts\n\n```bash\n# Start development server\nnpm run dev\n\n# Build for production\nnpm run build\n\n# Preview production build\nnpm run preview\n\n# Lint code\nnpm run lint\n```\n\n## Security Considerations\n\n- ✅ All critical functions use `nonReentrant` modifier\n- ✅ State updates occur before external calls\n- ✅ Access control enforced (creator\u002Fowner checks)\n- ✅ Input validation on all user inputs\n- ✅ Safe external transfers with proper error handling\n\n\n## Support\n\nFor questions, issues, or feature requests, please open an issue on the repository.\n- Telegram: [@devsealva](https:\u002F\u002Ft.me\u002Fdevsealva)\n\n---\n\n**Built with ❤️ for the decentralized prediction market ecosystem**\n","这是一个生产就绪的加密预测市场平台，结合了安全智能合约和现代化React前端。项目核心功能包括点对点投注、多重签名托管、自动支付以及全面的安全措施。技术上，后端采用Solidity编写智能合约，并通过Hardhat进行开发与测试；前端则基于React框架构建，使用TypeScript编写代码，同时集成了wagmi\u002Fviem等库以增强钱包支持和用户体验。适用于需要在EVM兼容链上搭建去中心化预测市场的场景，特别适合那些重视安全性和易用性的开发者或团队。",2,"2026-06-11 03:54:37","CREATED_QUERY"]