Salahdine Parnasse

Salahdine Parnasse

Table of contents

  • Links
  • Project overview
  • Key project points
  • Media

Les liens

Label
Lien
Mint
Open Sea
Etherscan
Twitter
Article LinkedIn

Project Summary

💡
In March, following the successful launch of an MMA athlete's NFT collection, Salahdine Parnasse's agent wishes to launch a collection for his champion.
🛠️
Several proposals are made to establish the best approach for the specificities of the smart contract. A streamlined solution will be chosen: no whitelist or transaction limit. A reveal system will be put in place, as well as some freemint offered to the community.
🔥
3 distinct types of NFTs can be obtained randomly:
  • 600 classic cards with a chance to win a private training session with the champion
  • 200 rare cards to win training sessions according to the "finish"
  • 5 legendary cards to win fighter's equipment or a day paid for to attend a backstage fight.
🏁
At launch, the project counts 28 sales in a few hours. This may not be the expected result, but Salahdine's manager sees it as an opportunity to continue the project in the long term.

Key points of the project

The Mint contract

This is the foundation of any NFT project: a smart contract capable of issuing non-fungible tokens. Several standards exist, each with its advantages and disadvantages. The most well-known are ERC721, ERC721A, and ERC1155. For this project, we chose the Azuki ERC721A standard.
 
This implementation has the advantage of offering low-cost multiple mints like ERC1155 while keeping the basic ERC721 implementation.
 
The implementation of the ERC721A contract for the Salahdine project differs in two ways:

URL management.

An override of the functions allowing the retrieval of URLs redirecting to the metadata of the NFTs.
The goal of this change is to display a placeholder image before revealing the real designs to users.
notion image

Adding a SignList

Many NFT projects use a whitelist system to favor and reward certain members of their community. There are several ways to set up whitelists in Solidity. But the most optimized technique I have found to date is based on an address signature principle.
 
  1. An account A is used to sign the address of the buyer B.
  1. The signature is sent as an argument when calling the mint function.
  1. The smart contract uses the recover method to prove the authenticity of the signature based on the sender.
 
An example of the function used to verify the validity of the signature:
For more information https://www.instagram.com/p/Cb93bcYt1jt/, I talk about it on my Instagram.
 

The Resolver

When a third-party service wants to display the visual representation of an NFT, it must call the tokenURI(uint256 tokenId)function to obtain a URL where the NFT information is located in JSON format most of the time.
 
There are several services that allow you to easily upload your metadata online such as Pinata. However, I am not a fan of these solutions because you are no longer in control of your data, some services are paid and you depend on their resilience.
 
That's why I set up a Python application using FastAPI and Alchemy API to create my own metadata resolver.
The tokenUrimethod of my smart contract redirects to this micro-service running on one of my servers. Then I use Alchemy's services to determine if the requested NFT has already been minted or not. If this is the case, I return the corresponding metadata.
notion image
Alchemy dashboard allowing to measure the usage of the API that validates the metadata management
 
And what about data decentralization?
This system has a flaw, as the metadata of NFTs are stored on a conventional server. However, this is not a fatality in this type of project.
  • Images are stored on IPFS, only metadata such as name / description / attribute are stored on the server.
  • To ensure data integrity, the hashes of all metadata are made public at the beginning of the sale, and a means is given to verify their validity.
  • The user always has the option to Freeze their data via OpenSea.
  • Most NFT projects wish to make some adjustments shortly after their release. This offers them a little more flexibility while still being in line with their community.

Integration on a website

The Next.js application has been deployed for the project. This serves as a showcase website to present the project and its designs. It also allows buyers to acquire their NFTs.
 
A web3 module allows wallet connection via metamask only. For this project, only metamask was selected as a provider, as it was sufficient for the scope of the project. Moreover, this allowed for a manual implementation and thus not having to rely on a third-party service to ensure the security or maintainability of the project.
notion image

Deployment automation

To allow for maximum responsiveness during deployment or development phase, many tasks are automated.
 
For the deployment of smart contracts, deployment pipelines with scripts have been created to avoid paying high gas fees.
 
Numerous unit and functional tests for all project features are present, and modules also allow for predicting the amount of gas that will be consumed by different methods. Security audits are also conducted using tools such as Slither.
notion image
 
For deploying web applications, database, reverse-proxy, and resolver, Docker and Docker compose are of great help. They allow to quickly launch, recompile, modify, and stop the entire application stack or a part of it. This is very useful, for example, for quickly downgrading or upgrading server power depending on the situation.
notion image
 
CloudFlare is also used as a proxy for production servers. This allows for caching to reduce server load time and provides more security to the project.

Media

notion image
notion image
notion image
notion image