I am currently working on a smart contract to sell ERC721 tokens. I understand that my code should have a function that allows me (the owner) to mint a token and add it to a list which stores all the available tokens. But what I don't quite understand is when and where do I define which data can be used to mint a token.
Suppose I have a dapp that allows you to buy Colour tokens. In my frontend, the user will have Red, Yellow and Blue, and they all will have different prices. When they buy one of them, using web3 I will mint a token and transfer it to the buyer.
But how does the frontend know that the available colours are red, yellow and blue? How can I prevent someone creates a green token? Do I have to provide this data (and also the metadata) in the deploy? How?
I hope that my question is clear.
Thank you very much!