Schadesoft / RockPaperScissors-_Contract

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RockPaperScissors Contract

In this smart contract, player 1 deploys the contract and sends the bet amount as part of the deployment. Player 2 then joins the game by sending the same bet amount and their hashed choice. Once both players have joined and provided their hashed choices, they can reveal their choices by sending their choice and the secret used to create the hash. The smart contract checks that the revealed choice matches the hashed choice, and then calculates the winner based on the traditional rock paper scissors rules. If there is a winner, the funds are transferred to the winner, and if there is a draw, the funds are refunded to both players.

About

License:MIT License


Languages

Language:Solidity 100.0%