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
- Install all dependecies:
npm install
# or
yarn
- To start local development server:
npm run dev
# or
yarn dev
- Install all dependecies:
npm install
# or
yarn
- Compile the contracts:
yarn hardhat compile
- 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
- Run this script to deploy the contracts:
yarn hardhat deploy-zksync
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. |
Interested to build with zkSync? Check out these links below: