openzeppelin-labs
openzeppelin-labs copied to clipboard
Design legacy NFT onboarding methodology
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.
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.