It is a beginner-friendly Solidity smart contract that allows players to join a simple number prediction game. Players choose a number between 1–10, pay a small entry fee, and wait for the game owner to reveal the winning number. If their prediction matches, they share the prize pool!
Features : -
Join the game by paying a fixed entry fee (0.01 ETH).
Guess a number between 1 and 10.
Owner reveals the winning number.
Winners are rewarded automatically from the contract balance.
Owner can reset the game and start a new round.
Smart Contract Functions Function Description Access enterGame(uint guess) Player joins the game with their guess (1–10) by paying 0.01 ETH. Public revealWinner(uint winningNumber) Reveals the winning number and distributes rewards. Only Owner resetGame() Clears all players and restarts the game. Only Owner getPlayerCount() Returns the number of current players.
The mission summary for this project can be summed up as: 1.Secure Player Participation
The contract stores each player’s prediction along with their paid entry fee, ensuring transparent participation.
The game owner reveals the winning number on-chain, triggering the contract to evaluate all predictions.
If correct predictions exist, the prize pool is split equally among the winners.
If no one wins, the pool stays in the contract for the next round or owner-defined use.
It is created to provide a simple, engaging, and educational introduction to blockchain gaming through a beginner-friendly Solidity smart contract. The project aims to help new developers understand essential Web3 concepts such as smart contract interactions, payment handling, randomness simulation, and decentralized game logic—without overwhelming complexity.
It focuses on creating a transparent, fair, and fun experience where players can participate in a lightweight prediction game, learn how blockchain-based games operate, and explore how on-chain mechanics manage players, rewards, and outcomes. It bridges the gap between theoretical blockchain knowledge and hands-on development by using an intuitive, easy-to-follow game.
India