Skip to content

Instantly share code, notes, and snippets.

@alexroan
Created March 24, 2020 12:34
Show Gist options
  • Save alexroan/bd36ded843353d40a902646da3721712 to your computer and use it in GitHub Desktop.
Save alexroan/bd36ded843353d40a902646da3721712 to your computer and use it in GitHub Desktop.
examples/solidity-access-modifiers
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