project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5
project screenshot 6

RoyalGame

Royal is a decentralized prediction dapp where users stake and guess numbers, combining them with ChainLink data feeds, competing for a prize pool based on the closest match to the final combined number.

RoyalGame

Created At

ETHOnline 2024

Project Description

Welcome to our decentralized application (dapp), where you can participate in an exciting prediction game! Here's how it works: Contract Info -> The contract is deployed on Scroll sepolia Contract Address: 0x5FbDB2315678afecb367f032d93F642f64180aa3

Club Creation: Any member can create a club. When creating a club, we fetch the current ETH/USD price from ChainLink and save it securely on the blockchain.

Club Opening: The club is open for 2 minutes, during which interested players can join and participate.

Prediction Proposal: Before the game deadline, players must propose the price they predict for a certain event. The game is open for 5 minutes.

Guessing Game: Players choose a number between 50 and 100. This number is then combined with the data feed fetched from ChainLink.

Reveal and Reward: At the end of the game, the smart contract reveals the combined data feed (summed with a random number). If a player's prediction matches or is closest to the revealed number, they win the full prize from the club pool.

How it's Made

ChainLink I Usedd Price Feed in my project. User have to Guess a number b/w 50-100, then have to sum up with the pricefeed shown on their dashboard after that at the end of the smart contract will reveasl the winner.

Please refer this code to see how I used Price feed in my project -> https://github.com/Vikash-8090-Yadav/RoyalGame/blob/main/Frontend/src/pages/createclub.jsx#L194 State Chnage -> if user won then he / she can claim full bonty prize (Only when won) https://github.com/Vikash-8090-Yadav/RoyalGame/blob/main/Frontend/src/pages/proposal.jsx#L208

background image mobile

Join the mailing list

Get the latest news and updates