All state variables should be private #1174
Labels
breaking change
Changes that break backwards compatibility of the public API.
contracts
Smart contract code.
Milestone
Solidity adds public getters to public state variables. This is kind of magical and dark, and could lead to mistakes.
We should be more explicit on everything we do, to make the code clearer and easier to review. So let's get rid of the automatic getters making all the public state variables private. If the variable has to be accessed from outside of the contract, we should add a getter function that should be either internal or public, depending on how the contracat is designed.
This gives us an extra benefit because the state variables will be implementation details and this allows us to make some changes without modifying the public API of the contract.
The text was updated successfully, but these errors were encountered: