Inspiration
We got inspired by the possibilities that ZK-proofs provide. The ability to hide strategies when playing on-chain games will be a major use case for ZK-proofs. Seeing how popular football and football manager games are, it will be a great way to onboard new people to Aleo.
What it does
On the frontend a user can create a new game. He first selects his team and then chooses the 11 players. This information is stored privately, so when an opponent joins the game he cannot see the strategy.
Hackathon scope
We have implemented a very simple game mechanic for the sake of the hackathon, it just allows for goals scored. Future versions will implement more sophisticated logic including red/yellow cards, free kicks and penalties. Also the player stats are simplified for the hackathon implementation, it just has attack and defense. This will be expanded so the users can select more complex strategies and formations.
How we built it
- We wrote smart contracts in Leo and used the Aleo SDK to setup a template project.
- We implemented the Obscura SDK to create leaderboards
Challenges we ran into
- We are both new to Aleo/Leo, so it was difficult to write the smart contract.
- We did not manage to deploy our smart contracts at first, because we were getting 503 errors. We did write a test file to show our contracts are working and the game can be completed and the leaderboard will be updated. Just before we finished we did manage to deploy useing aleo.tools, but we lost time thinking of workarounds.
- We did not have time to implement the Puzzle SDK, so currently there is the case where players can abandon games without a penalty. This will be part of a future implementation of the game.
- When we wanted to connect the Leo wallet, but switching between wallets on one device didn't update the wallet shown on the frontend. We ended up hardcoding our wallets/privatekeys in the frontend.
- Using the Leo official wallet for testing was not very developer friendly since it requires a "complex" password. When I am testing I want to use either no password or a simple password.
Accomplishments that we're proud of
We learned a new language, we build a great frontend and game in just 2 days.
What we learned
We learned that it's quite a challenge to finish a project when it's not possible to deploy on testnet. The workaround took a lot of time, which felt like wasted time since it's not contributing to the actual progress of our project.
Hackathon bounties
Kryha - Best zkLeaderboard
The leaderboard leo contract is extended to include more fields. We log the results (win, draw and loss) and goals score/conceded. Based on these values we can calculate total points, number of games played and goal difference values that are also shown in the frontend. The update_score function from the leaderboard contract is called from the game_logic contract. After each game is played, the leaderboard will update based on the outcome.
Puzzle - Best Casino Game
The project needs to leverage the Puzzle SDK to prevent ghosting by players who think they will lose after the formations are revealed. By setting a timelock on the multisig, the player who ghosts will automatically forfeit the game if the timelock expires. This mechanic ensures all games will be played, since the outcome of forfeiting is always worse than playing the game. This functionality of the Puzzle SDK is currently not implemented, but will be added as the next feature.
What's next for Super Leo Lig
We think the idea has a lot of potential and a game like this could be used to onboard a lot of people to web3/Aleo. After we showcased the project for judging we would like to discuss with Aleo how to go forward. We are motivated to continue building this game, and get a version with more sophisticated game logic and tournament/leagues ready on testnet soon.
Built With
- javascript
- leo
- obscura
- puzzle
- react
Log in or sign up for Devpost to join the conversation.