unnecessary virtual keyword
To my understanding from what I've read in the documentation is the virtual keyword in the function header of _baseURI not needed.
It's only
Base functions can be overridden by inheriting contracts to change their behavior if they are marked as virtual
and
he overriding function must then use the override keyword in the function header.
However, if we were to inherit CryptoDevs once more, we would would need virtual.
If you do not mark a function that overrides as virtual, derived contracts can no longer change the behaviour of that function.
To my feeling, we should only focus on the syntax that is needed, as many beginners are not aware of such nuances, they copy paste this code for other projects as well and sets up not best practice.
/**
* @dev _baseURI overides the Openzeppelin's ERC721 implementation which by default
* returned an empty string for the baseURI
*/
function _baseURI() internal view virtual override returns (string memory) {
return _baseTokenURI;
}
Hey @yvesbou
This isn't really an issue since the purpose of this lesson is focused on getting started with a ERC-721 contract (plus, to my knowledge, virtual does not have any effect on gas, nor create vulnerabilities), but since this contract/function isn't intended on being overridden we can omit the virtual keyword, sure.