I am learning how to write a smart contract for NFT collections and the following is the example function given by the tutorial I read:
function _burn(uint256 tokenId) internal virtual override {
super._burn(tokenId);
if (bytes(_tokenURIs[tokenId]).length != 0) {
delete _tokenURIs[tokenId];
}
}
I recognise that this function will not remove the token from the blockchain entirely. Instead, it will remove the URI of the token (regardless of who owns it). As a result, the token will still in the collection and be displayed on trading platforms, but the metadata will be gone (but it may take time to be in effect as platforms are not refreshing metadata frequently).
I wonder if this is the right practice for burn function. It would be greatly helpful for me if someone can provide me an example of how burn function is achieved on other NFT smart contracts.


