Inspiration

5Polygons is a 3in1 smart contract which includes a game, NFT tickets and raffle system. The arts are inspired by the Polygon blockchain, providing players NFTs with polygon arts.

What it does

Players can bet as much as they want, then they get 5 randomly given polygons. They earn a reward depending on their result. The good part is regardless of you win or lose, you get a free NFT representing your polygons. This NFT is also used as a raffle round ticket.

How we built it

Polygon Blockchain: 5Polygons is built on EVM using Solidity language. Used Hardhat to compile and deploy the contracts.

Chainlink VRF V2: It is powered by Chainlink VRF V2 for the random results. The NFTS are kept as ERC1155 on the smart contract.

NFT.storage: We used nft.storage to upload 3000+ nft images and 3000+ metadata files to ifs with a single script.

AWS Amplify: We used AWS Amplify for our react app frontend hosting.

Challenges we ran into

5Polygons has a raffle system that shares the 30% of the bets with the lucky users. On every raffle round, this balance is divided into two: -half goes to the lucky NFT holders -half goes to a lucky better on that raffle round This way new users have a way to win half of the raffle round with equal chance as everyone The other half goes to the owners of randomly chosen NFT id. This way a user who minted that NFT months ago also has a chance to win the reward. The more NFT users have, the more chance they have to win the reward.

Accomplishments that we're proud of

I believe the 3in1 smart contract has a good strategy and also represents the Polygon blockchain with the arts.

What we learned

Having multiple strategies and game flow in a single contract.

What's next for 5Polygons

The next step is going on polygon main net and have a dynamic NFT system that lets users/designers to add more polygon arts to the game.

Demo link: https://master.dnxg0679qf44f.amplifyapp.com/

Repo (contract and frontend): https://github.com/cemleme/5Polygons

Built With

Share this project:

Updates