Remove burn functionality from ERC721

Hi,

I am inheriting the open zeppelin erc721 token. I have set a cap in the beforetokentransferfunction to ensure totalSupply() is < cap.

I am not overriding or calling the _burn function anywhere inside of my contract, because I don’t want anyone to be able to burn minted tokens. can I be 100% certain that my totalSupply() will never decrease, or would it be better to remove the _burn function entirely from the erc721 token I import ?

Also is it possible for an outside address or contract to call my internal functions once my contract has been deployed? My assumption is that it is impossible.

Thank you

1 Like

Hi @Aizea,

No one can call the internal burn function unless you have functionality that does this.

If you are extending OpenZeppelin Contracts ERC721 implementation, (and not extending ERC721Burnable) and you don't have any functionality that calls the internal _burn, then this function can't be called.

Please note, a token could be transferred to a non-zero address and be effectively put beyond use.

Internal functions can't be called externally.

https://docs.soliditylang.org/en/v0.8.1/contracts.html#index-3

Is there any issue with burning the tokens with opensea? Or do they maybe require that a collection of nfts token, don't implement the burn method? Thanks a lot!