Why private state variable

I'd love to get OZ's mind about something..

As seen on the line, _votingPeriod is private. This is due to the encapsulation pattern so child contracts wouldn't have direct access to it to not allow improper/dangerous overwrite on it.

Though, votingDelay function is virtual, so In case change is needed, I can still override and achieve the same thing. What's your argument about having it like this and not making _votingPeriod variable internal ?

1 Like

It's a general policy we use consistently throughout the library. All variables are private, and no exceptions are made for particular variables.

1 Like

OZ convention to probably prevent conflicts.