What does `_disableInitializers();` function mean?

It isn't strictly needed, but it is recommended as a best practice.

The original motivation for disabling initializers was to have an extra layer of security related to UUPSUpgradeable Vulnerability Post-mortem.

But doing this also has the benefit of preventing users from using the implementation directly, and helps prevent others from overtaking the implementation in general (there is more risk for UUPS since UUPS has the upgrade logic in the implementation so you really don't want someone to overtake it, but in general the risk depends on your code).

1 Like