Skip to content

Smart contract implementation and Dapp for playing popular rock-paper-scissors game on EVM

Notifications You must be signed in to change notification settings

kelcheone/Ethereum-Rock-Paper-Scissors

 
 

Repository files navigation

Ethereum-Rock-Paper-Scissors

Rock paper scissors is a hand game usually played between two people, in which each player simultaneously forms one of three shapes with an outstretched hand. Based on the options chosed by participants, a winner is decided who gets a monetary or ad-hoc reward. The game is often used as a fair choosing method between two people similar to coin flipping (but not as random) In this work, we discuss the design and working of a decentralized version of the game using ethereum blockchain and smart contracts. Just like other popular dapps, it’s power lies in the transparency and incentivised model of smart contracts

Gameplay

  1. A user visits the game URL on Web 3.0 and registers to play the game. In order to register as a player in the game, he must confirm a payment of 5 ether to the contract.
  2. The user then selects a choice (Rock/Paper/Scissors) and enters a private keyphrase, to lock their choice.
  3. When two users are registered and have locked their choices, they claim their choices by entering the same choice and keyphrase they used while locking.
  4. When both users have claimed their choices, the winner gets a financial reward of 9.98 ethers. In case of a draw, both players receive 4.99 ethers each.

Demo Video : https://www.youtube.com/watch?v=t9GqZMbGugk

Detailed Report : https://www.doc.ic.ac.uk/~mks17/RPS_Report.pdf

About

Smart contract implementation and Dapp for playing popular rock-paper-scissors game on EVM

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • JavaScript 98.3%
  • HTML 1.5%
  • CSS 0.2%