Much Flip Game: Bootcamp Workshop zkApp
You need to login in order to like this zkApp. Click Here
Much Flip Game: Bootcamp Workshop zkApp
You need to login in order to like this zkApp. Click Here
zkApp – Much Flip Game: Much Flip Coin is a challenging game built with SnarkyJS. Players must guess the computer’s choice and try to outsmart it. Motivation Carbonara aimed to provide an engaging and enjoyable introduction to SnarkyJS through this repository. The game’s logic is straightforward: it operates in rounds, with the code randomly selecting “Heads” or “Tails” at the start of each round. Players are tasked with predicting the code’s choice. How it works under the hood The game’s logic comprises two main components. Firstly, the user initiates the game, prompting the deployment of the contract. Then, the application determines the winning side through a transaction, followed by the user’s submission of their guessed side. The project is technically divided into two parts: the “smart contract” logic in the src/snapp folder and the rest of the logic/UI in the src/lib folder. Of particular interest is the snapp folder, housing two key files:
- contract.ts
- helpers.ts
The contract.ts file contains the actual contract featuring two essential methods, startRound() and submitGuess(). On the other hand, the helpers.ts file includes various functions to facilitate the invocation of the contract methods, such as variable casting and validation.
Categories: Mina Protocol zkApps , Gaming , Workshop zkApp ,