Inspiration
The Initial idea of GemFi concept was thought by rabTAI; His inspiration came from using NFTs in Game-Fi. He shared the idea with RoshuAngel who then worked on the SVG of the Gem. Since we are launching in the FTM, RoshuAngel wanted to incorporate the blue color of FTM and that's where the Sapphire with FTM logo in the middle was created.
What it does
GemFI is a cutting-edge SVG NFT-based, user-driven GameFi project that puts all the power in the hands of the players. It is an engaging and dynamic GameFI with the unique thrill of potentially winning the big “Gem Pot“. Players begin by minting three (or 3x) level 1 Gems, each with a starting balance of 1. To increase their level players can upgrade Gems by sacrificing three of the same level Gems to mint a new, more powerful Gem. A successful 3:1 Gem Upgrade results in newly minted Gem with a total sum of the balances from sacrificed Gems, This means that the player is not losing any money, while they are effectively increasing their chances of winning the coveted Gem Pot.
If the upgrade fails, a new Gem is returned with the same level and the balance from one of the three Gems . The balance from the second Gem is refunded to the player in FTM, while the balance from the third Gem is accumulated in the Gem Pot. Failed upgrades are calculated randomly based on the level of the three Gems, which adds an exciting element of risk to the game. Upgrading Gems is a way to invest in the game and potentially reap a reward, while failed upgrades provide an opportunity to recoup some of the investment.
The Gem Pot is awarded to one of the players with the highest level Gem, and the prize is collected based on the number of failed upgrades from all players. This means that the more unsuccessful upgrades there are, the larger the Gem Pot becomes which will be scooped by one of the lucky players. The function 'pick winner' can be called by any eligible player every 24 hours, although this frequency can be changed at a later time.
The Gem Pot winner is pulled randomly from all the eligible highest ranked Gems, so it is possible for a player to have multiple highest ranked Gems and increase their chances of winning the Gem Pot prize. The more Gems a player has with the highest rank, the more chances they have to win the prize. This adds an extra layer of strategy and excitement to the game, as players can choose to upgrade different Gems and invest in their potential to win the Gem Pot prize.
How we built it
Contract was created with solidity version ^0.8.19 and tested using Hard Hat. It imports openZeppelin
Front end was built using bootstrap 5.1.3, HTML 5, Css, javascript, jquery and web3.js. Contract interaction was tested in local chain with hardhat, and also FTM testnet. We are using paint swap Api to get user owned NFT
Challenges we ran into
rabTAI: Getting random number without using Chain Link
Roshu_Angel: Testing contract interaction and making sure it works correctly. Since the contract was changing and evolving, different tests were done.
Accomplishments that we're proud of
rabTAI: Working GameFI, and the logic of gem upgrade
Roshu_Angel: I ended up learning how to use hardhat to compile and deploy the contract in a local node (forking the mainnet), connecting metamask to the local chain and running tests. This saved us from having to deploy the contract in testnet with every change in the contract.
What we learned
rabTAI: Different and new ways to randomize in solidity
Roshu_Angel A lot of solidity side, compiling and deploying contracts, make user friendly, interactive front end.
What's next for GemFi
We want to see how people react to the GemFi and we will come up with more fun game with version 2.0
Log in or sign up for Devpost to join the conversation.