It starts to make less sense…
as @frangio said, he uploaded a folder on pinata and the folder contained the text files
2 as the names.
Now, let’s say we mint tokenId as
1 on the smart contract. Now, if I want to get the URI of this tokenId = 1, I call
tokenURI which returns
1 . The same scenario with
tokenId as 2.
Now, the problem is that before the
tokenId was minted, the data was already created, and uploaded on pinata, which means that if tokenId = 8 gets minted, even before it gets minted, its data should be written to pinata.
Question 1: So, after the folder gets uploaded to pinata which contains
folder which contains
3 files and so on, no one can add new ones, but for sure
3 and all other files contain different data in it. but the problem is that no one can add more numbers in the folder. Right ?
Also, @abcoathup mentions :
This means that you need to predefine the metadata , but I think, we not only need to predefine the metadata, but predefine the array of metadatas , because each tokenId has one metadata and we need to have multiple metadatas defined as multiple tokens have to be minted. Right ?
Question 2: can I add new file in the folder once it’s been uploaded to
pinata ? seems like I couldn’t find this option. Other than moving all the files in the new directory.
Question 3: If I use IPNS, then it means that
BaseURI on the contract should be the IPNS hash and not the IPFS one, right ?
Question 4: It really loses point at some point. using
setTokenURI is still an amazing solution. Can we talk about why using
setTokenURI is bad because of gas costs ? if we store tokenURI as IPFS hash which is 32 bytes(1 storage slot need), I don’t see so much gas costs related to this solution. What do you think ?