‘You Are A Good One’ Updatable NFT Collection

1 minute read

Description

This is an experiment in creating an updatable and expanding set of NFTs. The NFTs themselves are simple inspirational phrases that are assigned a number on creation. But rather then creating a limited set of NFTs by defining all of them in the contract, the idea was to be able to continue to add new NFTs and update and expand the collection as time goes on – and as new ideas arise.

In order to accomplish this, the contract method accepts a string when creating an NFT. But in order to prevent a clever user from injecting their own string / phrase into the NFT, permissions had to be controlled. Hence, I created a backend server that cryptographically signs the string when passing it to the contract method. This signature is verified on the contract, and the NFT is only minted when verified.

Preview

Check out the solidity contract, code on Replit, and more »

Objective

To learn Solidity more in-depth by solving the problem of creating an updatable, expandable NFT collection!

This is a work in progress, but overall I am happy with my current solution :) I will continue to refine certain aspects of it, such as deleting the submitted svg string from the database so it can’t be reused, and improving the web app’s UI.