hackquest logo
  • 学习
  • 课程探索
  • 实战
  • 探索黑客松
  • 往期项目
  • 社区
  • 论坛
  • 全球活动
  • 我的社区
  • 共学营
  • 组织中心
  • 更多
    • 词汇表
    • 博客
    • 水龙头
    • 工作机会
    • 媒体工具包
    • 创始人
hackquest logo

GUESSING GAME

A blockchain-based number guessing game where players submit guesses with Ether, and correct guesses win the contract balance automatically.

技术栈

Solidity

描述

The Number Guessing Game is a smart contract written in Solidity that enables players to guess a secret number. The contract operates as follows:

  1. Setting the Secret Number – The owner (first user to set the number) defines the secret number.

  2. Submitting a Guess – Players send Ether along with their number guess using the guess() function.

  3. Winning Condition – If the guess matches the secret number, the player wins and receives the entire contract balance.

  4. Bet Management – The contract ensures that players send at least the required bet amount.

  5. Resetting the Game – The owner can reset the game with a new secret number.

  6. Security Measures – Only the owner can modify the game settings, and the contract prevents unauthorized actions.

The contract is deployed on Ethereum, and interactions are managed using Web3.js for frontend or script-based execution.

本次黑客松进展

30

融资状态

0
队长
Hhq_1743492914
项目链接
赛道
DeFiAI