2

Example:

address public owner;

Also, if we don't make a variable public manually, what is the default, private?

3

See https://programtheblockchain.com/posts/2018/01/02/making-smart-contracts-with-public-variables/ for a full explanation.

Yes, the default visibility for state variables is private. Marking it public makes it easy to read the variable in a DApp or from another smart contract.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.