opinion-market
Simple prediction market. It tries to gather user opinion using vanila prediction market.
Screenshots



Problem Statement
Encrypted Prediction Markets on Fhenix Decentralized betting platform using Fully Homomorphic Encryption (FHE) on the Fhenix network. Key FeaturesPrivacy-preserving betting with FHE Decentralized market creation Binary outcome betting (support/oppose) Automated settlement and fair payout distribution ERC20 token integration for betsTech StackSolidity 0.8.24 Fhenix Protocol's FHE.sol Hardhat deployment Fhenix TestnetProcessDeploy market with question and expiry Users place encrypted bets Settlement triggered post-expiry Outcome determined via decrypted totals Winners claim proportional payouts
Solution
Smart Contract (Solidity 0.8.24):Implements market logic, betting, and settlement Uses OpenZeppelin for ERC20 interactions and safety checksFully Homomorphic Encryption (FHE):Leverages Fhenix Protocol's FHE.sol for encrypted operations Keeps individual bets and votes private on-chainCustom ERC20 Token:Used for placing bets and distributing winningsHardhat Development Environment:Compilation, testing, and deployment management Custom scripts for deployment and contract verificationFhenix Testnet Deployment:Targets Fhenix network for FHE capabilities Ethers.js for contract interactionsEncrypted Data Structures:Uses euint128 for encrypted integers Custom structs combine encrypted and decrypted dataAutomated Market Settlement:Time-based expiration trigger Decrypts totals only at settlement for fair resolutionThis implementation showcases advanced cryptographic techniques in DeFi, enabling private, tamper-resistant prediction markets on blockchain.
Hackathon
ETHOnline 2024
2024