Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ausaf007/web3-game
Web3 Application to play Rock, Paper, Scissors, Spock, Lizard
https://github.com/ausaf007/web3-game
dapp javascript react reactjs web3js
Last synced: 4 days ago
JSON representation
Web3 Application to play Rock, Paper, Scissors, Spock, Lizard
- Host: GitHub
- URL: https://github.com/ausaf007/web3-game
- Owner: ausaf007
- License: mit
- Created: 2023-07-24T15:15:10.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-10-08T12:10:13.000Z (about 1 year ago)
- Last Synced: 2023-10-08T13:23:49.502Z (about 1 year ago)
- Topics: dapp, javascript, react, reactjs, web3js
- Language: JavaScript
- Homepage: https://web3-game-five.vercel.app
- Size: 222 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
RPS Game
Web3 dApp to play Rock, Paper, Scissors, Spock, Lizard
Table of Contents
## About The Project
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). Built with Web3js and openzeppelin-contracts. Simple dApp
to play Rock, Paper, Scissors, Spock, and Lizard with this smart contract: [RPS.sol](https://github.com/clesaege/RPS/blob/master/RPS.sol)
## Game Rules
A Simple Way to Remember Who Wins:
> Scissors cuts paper.\
> Paper covers rock.\
> Rock crushes lizard.\
> Lizard poisons Spock.\
> Spock smashes scissors.\
> Scissors decapitates lizard.\
> Lizard eats paper.\
> Paper disproves Spock.\
> Spock vaporizes rock.\
> Rock crushes scissors.
## Tech Stack
[![](https://img.shields.io/badge/Built_with-React-blue?style=for-the-badge&logo=React)](https://react.dev/)
[![](https://img.shields.io/badge/Built_with-Javascript-yellow?style=for-the-badge&logo=Javascript)](https://developer.mozilla.org/en-US/docs/Web/JavaScript)
## Prerequisites
Make sure to have Ganache, Truffle, and NPM installed.
## How To Use In Dev?
1. Get Ganache running locally. Add local Ganache network to Metamask and connect it to the local Ganache instance. Import atleast 2 accounts to metamask.
2. Navigate to `web3-game/`:
```
cd /path/to/folder/web3-game/
```
3. Fill in the `.env.sample` file, and then rename the file to `.env.development`. Here are some details about the fields in the config file:
1. `REACT_APP_TIMEOUT`: Duration before which the other player can recover ETH in case non-activity. Default is 5 minute. (Default=300000)
2. `REACT_APP_POLL_FREQUENCY`: Polling frequency to check if the other player has reacted. (Default=5000)
4. Get dependencies:
```
npm install
```
5. Run the app:
```
npm start
```
## Contributing
Feel free to fork this repository, make changes, and submit pull requests. Any kind of contributions are welcome!
## License
[MIT](https://github.com/ausaf007/web3-game/blob/master/LICENSE)