Created
March 24, 2020 12:34
-
-
Save alexroan/bd36ded843353d40a902646da3721712 to your computer and use it in GitHub Desktop.
examples/solidity-access-modifiers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity >=0.5.0; | |
contract AccessModifiers { | |
// Public modifer exposes a getter for state variable | |
string public myString; | |
// Private variable only accessible within contract | |
string private myPrivateString; | |
// Internal functions can only be used within this contract | |
function innerFunction() internal {} | |
// External functions are part of the contract interface and can be called from outside | |
function outerFunction() external {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment