Inspiration

This project actually started out with us ideating around what real world NFT interaction would look like. With our connections with bartenders in NYC, we were thinking about Cocktail NFTs that could be pre minted for an event, and a market for these drinks leading up to the event.

We decided to tweak it to try out a digital only "game" version of this event and bar. And then we saw Degen Apes were one of the sponsors and the theme fit so perfectly we had to incorporate them.

What it does

There's two basic concepts at play, the Bar and the Market.

At the Bar, you can add up to four drinkers to your table. While these drinkers can be any NFT, a generic NFT will only have a tolerance of 100. Degen Apes, based on the rarity of their various attributes, will have significantly higher tolerances.

After you've added a couple drinkers to the table, you can start minting drinks. These are Stardust NFTs, each unique. Eventually, when Stardust add in the ability to withdraw these to the user's wallet, we will as well.

Drinking the drink computes a roll based on the hash of the drink divided by the tolerance of the drinker at that point in time. The higher the tolerance, the lower the roll, and more likely it meets or comes under the threshold for DEBAUCHERY. If the roll is low enough, drinkers get awarded with event badges that outline some of the behavior they exhibited while at the bar.

Drinking isn't the only thing you can do at the bar! You can buy shares in the liquor suppliers that bring alcohol to the venue. Every time a drink gets minted, 70% of it's mint value is distributed as market cap to the suppliers of liquor for that drink. If you own 10% of the shares of that supplier, you're entitled to 10% of there share value at the time you cash out. Hold onto the shares, and as more people mint more drinks, their values will continue to go up!

How we built it

We have a react front end that interacts with your Phantom wallet to read existing NFTs and sign transactions on your behalf.

To ensure that only the wallet signer is making a move, we sign each API call with the wallet's keys, and verify that signature on the backend.

We use the Stardust API to mint Drinks and Badges as NFTs, and Shares as FTs. The staking of the shares makes use of the burn and capped supply features of the Stardust API which are super useful.

For Degen Apes, we were able to get the list of rarities from solanafloor.com and made the drinkers tolerance for a Degen ape reflect the rarity of their various features. This was a cool way for us to integrate a completely different project into our game. Tolerance is a very important feature that determines how likely the player is to get a badge.

Challenges we ran into

Since we're using Phantom as a sign in service, we had to come up with signatures for all our API calls to make sure only the relevant user was able to mutate their player object.

Lack of paid minting on Stardust really had us stumped on how to get the drink and share minting working. We were able to get around it by using signed transactions. We create and sign a payment transaction on the front end, then pass it to the backend to be verified. We check that it's made out to the Bar's public key and that it's for the correct amount of SOL, and then broadcast it while calling Stardust API to mint the relevant token. This is used also for cashing out the shares.

We Degen Apes, the challenge we ran into was of verification and rarity check. It's really hard to verify an authentic NFT on Solana. The best way is if we had the list of mint ids of all the 10k Apes that we could compare against. Lacking that, we went with checking the creator array and the symbol to denote authentic Degen Apes.

Finally, the other big problem was how to actually get the rarity of the attributes on the apes. While they were listed on the website, they weren't available in a machine readable format on their website. We found a json object hidden in the network requests for solanafloor that had the rarities precomputed that were were able to use, which allowed us to incorporate rarities into our game.

Accomplishments that we're proud of

The signed API requests and local signed transactions were two extremely cool design patterns we learned that I'm super excited to use in further Solana development.

What we learned

1) It's really hard to verify authenticity of an NFT on Solana

2) Rust is hard and I'd rather use Stardust instead for my future projects

What's next for Degen Bar

As we talked about in the inspiration, we want to take this concept of Cocktail NFTs to the real world. We're hoping to use the proceeds from this hackathon to host an actual event at NFT.NYC where we can work with our connections with bartenders to do a cool gamified real world event where people can come and use NFTs.

Built With

+ 6 more
Share this project:

Updates