/savingsgame

Building an awesome savings game! Check the stream where we built this :) https://www.twitch.tv/moose_code

Primary LanguageJavaScript

Its up to you now

We have created the basics of the game in the stream https://www.twitch.tv/moose_code

Now its up to you to implement the withdraw function so all the tests pass! Please go ahead and give it a bash and open a pull request!

Chat to us on the wildcards telegram https://t.me/wildcardsworld if you need help or have any questions.

Welcome to the game of savings

Game of savings is a simple smart contract that helps users learn some of the most important concepts of developing in Solidity, to deploy awesome and safe smart contracts.

The rules of the game are as follows:

You decide that you and you friends need to learn how to save money better. You are always spending it buying beers instead of saving for the future. You say to your friends, lets all deposit R100 every month to save for the year. At the end of the year, we will split all the money deposited equally, with everyone who diligently saved every month.

i.e. those friends who only managed to save a couple months of the year would lose out!

If every one saves the whole year, well then we all learnt a valuable lesson and everyone gets their savings back!

How could this be implemented? Without blockchain, you and all your friends would have to trust each other, pass banking details etc.. and it could be quite messy. cd Implementing this on ethereum means that code is law and your system will behave exactly as intended without anyone being able to influence the outcome.


We are going to implement a simple version of the above game.

Can you think of how to implement this game so that it is safe?

Installation

Clone this repo and run the following to install dependencies

yarn

to compile your contracts run:

npx buidler compile

to test your contracts run:

npx buidler test

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT