Function _setTokenURI() in ERC721 is gone with pragma ^0.8.0

Hi @sjuanati,

OpenZeppelin Contracts 4.0 Beta was released this week.
It is a Beta release and there may be small breaking changes prior to the stable release. There isn't documentation on this yet.

Feedback on the Beta is greatly appreciated.

When you extend ERC721 you can add this functionality however you need. You can override tokenURI with your required logic.

You could use the implementation in OpenZeppelin Contracts 3.x. as a guide.

You can override tokenURI with your required logic when you extend ERC721.

You only need to override _baseURI if you want to use this information in your tokenURI function, such as concatenating _baseURI + _tokenURI. If you are only storing a _tokenURI then you could just return a _tokenURI.

2 Likes