Inspiration
For the LionHack Hackathon, as beginners into blockchain we started by exploring topics that we could base on some already known development. We also wanted to work towards working on Solidity from a blockchain developer perspective. Initially we started working on a bounty for the ViteX ecosystem. For this we had to utlize solidity++ as the ecosystem supports this extension of solidity. We also explored on staking process works with ViteX as we had to retrive APR, 30 day transaction history and 7 day Moving Average of each of their user on a Yield Dashboard and present it in the graphical representation. We had to understand the different forms of ledger structures (Blockchain, Block lattice, tangle, and flat set). For Dashboard we had intend to use ReactJs.
While exploring the ecosystem and connecting with the developers of ViteX, we came across that the API's are available to fetch the details from his system so it wont have much implementation in using Solidity and we can directly create some standard backend functions which will send the data to the dashboard. So for the hackathon we switched to work on some blockchain tech implementation.
So we came up with an idea to utilize this learning into a game application where we just start with the basic guess the game. This game will be a Game platform where we can series of different games, currently we intend to card a number of card games.
What it does
To begin the game, user logs in using the valid wallet ID and will have a set of random shuffled playing cards from which they would need to guess the correct next card based on the questions/conditions. The user can bid any value greater than zero.
The user will earn money based on the amount they will bid. So if the user is bidding 1 ETH . They would earn 1 for first question, 2 for Second, 3 for third and so on. They would only receive winnings once they have answered the 4th question, if not all winnings are lost. In other words, the first 3 questions generate winnings and the fourth pays them out. Sample Questions -
- Player has to guess the color of the first card.
- Player has to guess over/under for the next card.
- Player has to guess inbetween or not of the previous two cards
- Player has to guess the suite of the fourth card.
How we built it
- Solidity - We are using Solidity for developing smart contracts for deck of 52 cards as well the Guess the Card game.
- Arbitrum One - Platform where we will deploy our application as it had quiet low fee compared to other platforms
- RemiX - IDE for developing and testing our smart contracts.
- Integrations - We are still researching on what would be the most appropriate tech for building UI and if we could integrate with something like Pygame
Challenges we ran into
A first challenge in setting up the game that we ran into were setting up the mathematical probabilities and rewards such that this dApp would earn profits without losing user interest. From there, in implementation it was challenging for a beginner group to learn Solidity and then use it in implementing our app that features taking user input. Finally, working through generating random values in a dApp with the deterministic nature of Solidity contracts was difficult. We found ways around this by using block.timestamp, where we were able to produce the same result reliably yet dynamically in randomizing the drawing of cards.
Accomplishments that we're proud of
Working solidility code for guess the card game with functions working on test values compiled and deployed on Remix. Learning so much of the different ecosystems that operate around the blockchain.
What's next for Card game on Arbiotrum
We would work on UI to interact the Solidity functions and deploy the app on Arbitrum
Built With
- arbitrum
- solidity
- vite
Log in or sign up for Devpost to join the conversation.