C

Crypto Chess

Bet your Chess skills against anyone with Crypto Chess !

C

Crypto Chess

Bet your Chess skills against anyone with Crypto Chess !

The problem Crypto Chess solves

Many passionate chess players are used to playing chess on sites like lichess.org , chess.com where they have their previous games and stats recorded. Instead of building a separate chess applications we wanted bring the goodness of cryptobetting to these popular sites.
Features :
Currently works on lichess.org , soon to be integrated with chess.com 🌟
Players can bet different tokens in different amounts , winner takes all !* 🔥🔥
All games automatically have an NFT which can be used for collections and trading ✌️
Dapp size deployed has a size of mere 15kb which is efficient and consumes less gas 😇
Contracts are using openzeppelin UUPS proxy, so they can be upgraded the address by contract owner

*To prevent abuse a transaction fee of 1% of both tokens is levied

Why not create a custom chess app?

  • Creating custom chess app has many vulnerabilities and the app can be tampered with and hacked as well.
    Sites like lichess and chess.com already have a huge community and provide good security which can not be tampered with easily.
    Lichess has many awesome features like analysis board which can help you reassess and prepare better for games.

Future Scope with DAO
As more users grow since the contract is upgradable a DAO can be developed and then ownership can be transferred to it so as the community can control how much the platform fees should be and other important decisions like which platforms like Lichess, Chess.com should be supported.

Portability
The smart contract code is in Solidity which is EVM compatible so any blockchain running on EVM architecture will support our project. Provided chain-link provides jobIDs for those chains. As of now chainlink provides api support to most of the popular Chains.

Data fetching from the testnet
The data is fetched from the blockchain is done using events emitted by the smart contract. By using the graph we were able to index data of the smart contract in form of entites and that data can be fetched using GraphQL

Challenges we ran into

We Initially tried to integrate with chess.com as our main platform. The developer support and api documentation for chess.com is currently not updated. We also faced challenges to implement realtime chess game results. This would require a workaround but is totally possible , due to our timeframe we decided to switch to lichess.org which is also a very popular chess site and provides a whole lot of features like realtime api data updation which chess.com doesn't provide.
We used react for frontend , and calling smart contract was a new task which we accomplished after some time. Although the UI can be improved much easily we lacked a frontend coder so we managed to create a decent simple frontend.

Calling external API using chainlink in polygon mumbai testnet was a challange, the chainlink jobs in mumbai testnet were not updating the contract with value returned by API. Since the smart contract is compatible with all the EVM based chains, and the chainlink job has the fastest response in the kovan testnet, thus the smart contract was deployed and tested successfully on kovan testnet.

Discussion