You will create a smart contract named RockPaperScissors
whereby:
Alice and Bob can play the classic game of rock, paper, scissors using ERC20 (of your choosing).
- To enroll, each player needs to deposit the right token amount, possibly zero.
- To play, each Bob and Alice need to submit their unique move.
- The contract decides and rewards the winner with all token wagered.
There are many ways to implement this, so we leave that up to you.
Nice to have, but not necessary.
- Make it a utility whereby any 2 people can decide to play against each other.
- Reduce gas costs as much as possible.
- Let players bet their previous winnings.
- How can you entice players to play, knowing that they may have their funds stuck in the contract if they face an uncooperative player?
- Include any tests using Hardhat.
Now fork this repo and do it!
When you're done, please send an email to [email protected] (if you're not applying through Homerun) with a link to your fork or join the Slingshot Discord channel and let us know.
Happy hacking!