Public -> Internal function patter

Hi! I would like to ask why OpenZeppelin implementations of ERC standards always implement public functions that call internal functions. I used to understand this when public functions had to be access restricted, for example, which made sense to implement an internal function to be called at the constructor. However, OpenZeppelin now uses internal functions for almost all functions, even for basic visualization such as ownerOf() -> _ownerOf() in the ERC721.

Thank you very much in advance for your help.

Normally when we implement a public function that calls an internal function there are extra restrictions on the public function, taking ownerOf for example, you can see that it has an extra require statement that the internal function doesn't have.

1 Like