GraphemeNFT / rarible-scaffold

MIT License
0 stars 0 forks source link

minting requires IPFS hash #4

Closed dcsan closed 3 years ago

dcsan commented 3 years ago

image

current mintUI requires an IPFS hash, but script doesn't generate one til just before we mint?

should we create a temp IPFS hash to put in the web UI? why does the web UI even force you to specify it?

  console.log("Uploading buffalo...")
  const uploaded = await ipfs.add(JSON.stringify(buffalo))

  console.log("Minting buffalo with IPFS hash (" + uploaded.path + ")")
  await yourCollectible.mintItem(toAddress, uploaded.path, { gasLimit: 400000 })
tomosaigon commented 3 years ago

I think our workflow will be different.

We need to call a "mint" function in the contract which will mint (create) the token and set the random hex value. After that, the metadata.json can be generated using that value, and only then can the metadata.json's ipfs cid be saved as tokenURI.

dcsan commented 3 years ago

yep agreed. the above form is kinda weird IMHO. its as if you want to just make a mint and you already know the URL of some JPEG or something, not our use case at all. so like you say we will:

and we don't need to ask the user for anything