0

What I understood from this is that if a function has virtual keyword, it can be overridden. And if a function has the keyword override means it is overriding another function. So, does the function below means it is overriding the function _burn and at the same time allowing itself to be overridden?

function burn(uint256 tokenId) public override virtual {
    _burn(tokenId);
}
ratib90486
  • 83
  • 5

1 Answers1

0

Almost. It means there's another function named burn that is being overridden.
Whatever is inside this function is the new implementation, which in this case is the _burn function.

Everything else you mentioned is correct - virtual allows a function to be overridden, while override overrides an existing function with the same name.

ChefAharoni
  • 315
  • 2
  • 13