Let's say I want to create a fixed cap of 10,000 NFTs. I pre-generate the token_metadata and store it on IPFS. The token_ids are only recorded on the FA2 contract when they're bought.
If I don't want to store any individual token metadata (token_id, ipfs links) on-chain because it would be too expensive (creating 10,000+ big_map entries being the limitation), is there a "standard" so that wallets and marketplaces are able to load the metadata accordingly?
I loaded up my metadata on TzComet and it's complaining about this:
Optional View token_metadata is not there. This means that the contract is likely invalid: it must provide token-specific metadata using a big-map annotated with %token_metadata which was not found by TZComet.
This is how I'm initializing the contract:
class TZColorsFA2(sp.Contract):
def __init__(self, initial_auction_house_address):
self.init(
initial_auction_house_address = initial_auction_house_address,
ledger = sp.big_map(tkey=LedgerKey.get_type(), tvalue=sp.TNat),
token_metadata = sp.big_map({"": sp.utils.bytes_of_string('ipfs://QmTwyN85GfziB5BGhF2ELogeJRt6CwevZY729bahQqKHiD')}),
total_supply=total_supply,
allowances = sp.big_map(tkey=AllowanceKey.get_type(), tvalue=sp.TBool),
metadata = sp.big_map({"": sp.utils.bytes_of_string('ipfs://QmYgdJzbJAHvZw4BNb1NXqtFM4GKHaieWaFcLKHazQ78hy')})
)
I'm guessing there is no standard way to do this...
I suppose, I could go with this approach and not fully implementing the TZIP-012 standard is not a big problem. This is what tzcolors.io did and it doesn't seem like a big deal because their custom smart contract and webpage marketplace knew how to look up the token_id's back to their metadata.