Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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.

Rock Paper Scissors Lizard Spock en.svg

## 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)