Migrate metadata to new ERC721 contract

Hi, Rogers from CryptoTitties,

I want to be a part of this discussion because we’ve created our contract when erc721 was just a proposal and we add our own set of functions and didn’t add any reference to the imageUrl. We want to create our Metadata contract with the URL for each image and a way to mint new Titty (don’t worry nothing pornograpghic, actually just art to support breast cancer research). We already have our image set on IFPS and I am not user how to proceed:

  1. If we create a new contract, would it be possible to update the storage of the original contract?
  2. If we submit to opensea or other platform should we submit the new contract with the metadata or all the contracts?
  3. Can we use your ERC721URIStorage contract and probably IERC721Metadata.sol?

Thank you very much!

1 Like

Hi Rogers (@allurco),

Welcome to the community :wave:

If you have a predetermined number of tokens, then you could use a scheme where you store all the metadata in a directory in IPFS in advance.
For example:
baseURI: https://ipfs.io/ipfs/QmUm25XMSnUvxvi7XE9Xr8XwRdkNosmTDyKDDyxMajjytv/

Making the tokenURI be the baseURI concatenated with the tokenID as a string.
For example:

This would reduce the cost of minting as you aren’t having to store a tokenURI per tokenID.

Alternatively, you could use the extension ERC721URIStorage to store an IPFS hash per tokenID. Though this would have higher minting costs.

There is also a third option, of using centralized metadata. Your metadata could even use an image in IPFS.
For example:
baseURI: https://example.com/token/

Unless you setup your original token (preERC721) contract to do that, then I assume not.

You would just submit your ERC721 contract to OpenSea and other marketplaces.

Are you allowing existing token holders to convert to an ERC721? Either by wrapping their existing token as an ERC721 or swapping it.

Yes! Please see the Contracts 4.0 Timeline.

Hi Andrew (@abcoathup) ,

Let me rephrase our questions.

Here is our contract: https://etherscan.io/address/0xb39d10435d7d0f2ea26a1c86c42be0fd8a94f59b#code
1- Is it possible to keep this old contract and somehow link a new contract containing the URI to IPFS?
2- Do you think that we should wrap our old contract in a new erc721 contract based on the code above?

Thank you for your help.

1 Like

Hi @allurco,

I assume you could wrap your contract, you should appropriately test and audit any wrapper. First an owner would need to approve an allowance, and then in a second transaction call a deposit/wrap function which would call transferFrom.
You could look at wrapped crypto punks as an example of how this could be done.

You could set your metadata as either centralized or decentralized. It would be up to you.

Wrapping brings a wider audience as any marketplace that supports ERC721 can be used. Some platforms may give you a share of secondary sales.

Again, whether this is a good idea depends on what you want to do with your project.

I would look at some of the older NFT projects and see what has happened when they wrapped their legacy NFT contract as an ERC721.