openzeppelin-labs icon indicating copy to clipboard operation
openzeppelin-labs copied to clipboard

Design legacy NFT onboarding methodology

Open spalladino opened this issue 7 years ago • 1 comments

Similar to #19, but for ERC 721 tokens. The need came up during ETH Denver, when discussing additions to the ERC721, and how existing implementations should migrate to the finalized version of the standard.

spalladino avatar Feb 17 '18 00:02 spalladino

An opt-in migration strategy can work here as well.

function migrateToken(uint256 tokenId)  {
   require(ERC721(oldERC721Address).ownerOf(tokenId) == msg.sender);
   require(ERC721(oldERC721Address).takeOwnership(tokenId));
   //if there's metadata
   migrateMetadata(tokenId);
   require(ERC721(oldERC721Address).transfer(burnAddress, tokenId);
   _mint(msg.sender, tokenId);
}

The specifics of migrateMetadata will vary between tokens.

adklempner avatar Feb 20 '18 01:02 adklempner