Inspiration


What inspired me to create this project the way it is are core blockchain values that I actually strongly believe.\ Most of the problems that the world is going through today are caused by centralisation and curruption. And by creating this project I wanted to showcase very powerful utility that guarantee fair and equal chance to obtain something rare for everyone in completely decentralised, uncorrupted and manipulate resistant environment.

What it does


This project gives every user equal and fair chance to obtain rare NFTs.\ It's allowing everyone to mint NFTs that are:

  • decentralised - are not dependent on any centralised decision of single unit.
  • randomized - thanks to Chainlink layers are generated based on random numbers that are retrieved for certain user at the time of calling the function in uncorrupted, unpredictable way.
  • 100% on-chain generated - none of the layers will ever change their order or the way that they are presented
  • unique - minting two the same combination of layers is disallowed, and if Chainlink retrieve the same combination by any chance, user will be refunded with the price that he paid.

How we built it


Crooked Snouts consists of three segments, which are:

  • frontend app - built with React
  • backend api - built with NestJS
  • smart contract - built with Solidity and Hardhat.

Frontend part is using Ethersjs to help and allow users to interact with blockchain.\ Backend API, thanks to Alchemy-SDK is fetching users collected Crooked Snouts to display them for user on the website.

And the smart contract part which may seem a bit complex, let me share with you the architecure design figure:\ Figure 1

  1. Each variant is responsible to store get function which is returning big SVG string.
  2. All of those variants are stored in generator contracts. One generator for each layer.
  3. All generators are then passed to main contract which is CrookedSnouts.
  4. CrookedSnouts is the contract users are interacting with, its responsible to request to Chainlink for random numbers.
  5. Based on that random numbers generators are selecting the layer which corresponds to the given number.
  6. And then, token is minted and send to the user.

Challenges we ran into


There was many different challenges as for the most of the part I was doing everything for the first time, as this is my very first standalone web3 project. But for the example I had to figure out:

  • how to make all those contracts correspond to each other?
  • how to split all those contracts to avoid exceeded gas limit error?
  • what are the maximal possible capabilities of contracts to actually compute such large strings?
  • how to listen and react for certain events happening on my smart contract?
  • how to make sure each NFT is unique when I have different number ranges for each layer?

Accomplishments that we're proud of


In general I am very proud of myself that I was able to develop and deploy this project without resignation from the values that I strongly believe. And even that I had to completely change the architecutre and my take on this for couple of times, the project is just the way I wanted it to be from the very begining.

What we learned


I've learned a lot during this project about maximum capacity of smart contracts as there were many gas issues to fight with.

  1. What is the maximum size of a smart contract.
  2. What is the maximum variables capacity.
  3. How many contract arguments I can pass to the constructor.
  4. How to use Chainlink VRF
  5. Alchemy-SDK

What's next for Crooked Snouts NFT


As of now will try to build some community around this project to promote and advocate for the values that I love the most and strongly believe in as well as put some more work to slightly improve UX/UI on frontend part.

Built With

Share this project:

Updates