Skip to content

tchowd/guess-secret-number

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Guess Secret Number

A trustless secret number guessing game built on zkSync. Not even the contract owner knows the number!

  • Players must guess a number and stake at minimum 0.001 ETH (default) to play.
  • If the number is guessed correctly, the player will recieve 80% of the contract balance and 100 ERC20 Tokens.
  • If wrong, the ETH value staked will be added to the contract.
  • Players can all play against each other at the same time - expect delays.
  • Only the contract own can change the secret number.
SecretNumber.mp4

Getting Started

Quick start - Existing Contracts

  1. Install all dependecies:
npm install
# or
yarn
  1. To start local development server:
npm run dev
# or
yarn dev

Deploy new contracts

  1. Install all dependecies:
npm install
# or
yarn
  1. Compile the contracts:
yarn hardhat compile
  1. Using the bash shell environment run:
export ZKS_PRIVATE_KEY='<YOUR-PRIVATE-KEY-HERE>'

Change with your own private key of the Ethereum wallet you're using

  1. Run this script to deploy the contracts:
yarn hardhat deploy-zksync

Technologies

This project is built with the following open source libraries, frameworks and languages.

Tech Description
Next JS React Framework
zkSync A trustless protocol that uses cryptographic validity proofs to provide scalable and low-cost transactions on Ethereum.
OpenZeppelin A complete suite of security products to build, manage, and inspect all aspects of software development and operations for Ethereum projects.
Hardhat Ethereum development environment for professionals
Ethers A complete and compact library for interacting with the Ethereum Blockchain and its ecosystem.
WAGMI A set of React Hooks for Web3
Chakra UI A simple, modular and accessible component library that gives you the building blocks you need to build your React applications.
RainbowKit RainbowKit is a React library that makes it easy to add wallet connection to your dapp.

Resources

Interested to build with zkSync? Check out these links below: