Skip to content

Instantly share code, notes, and snippets.

@sepisoltani
Created October 8, 2021 12:06
Show Gist options
  • Save sepisoltani/c8f37821801756cce4d6e7533de68258 to your computer and use it in GitHub Desktop.
Save sepisoltani/c8f37821801756cce4d6e7533de68258 to your computer and use it in GitHub Desktop.
contract Sandwich {
uint private sandwichesEaten = 0;
function eat() internal {
sandwichesEaten++;
}
}
contract BLT is Sandwich {
uint private baconSandwichesEaten = 0;
function eatWithBacon() public returns (string memory) {
baconSandwichesEaten++;
// We can call this here because it's internal
eat();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment