Skip to content

Instantly share code, notes, and snippets.

@Oyinbayode
Last active October 28, 2022 08:04
Show Gist options
  • Save Oyinbayode/1a8834a5b2aea2774fb4be1accb3ee68 to your computer and use it in GitHub Desktop.
Save Oyinbayode/1a8834a5b2aea2774fb4be1accb3ee68 to your computer and use it in GitHub Desktop.
My Storage
/* ............... */
contract MyStorage {
// This creates a variable called Number
// private is a solidity keyword to make variable invisible to the public
// uint256 means unsigned integer and can take a memory of 2²⁵⁶⁻¹
uint256 private Number;
// This function assigns the inputed number to the Number variable
function storeNumber(uint256 _Number) public {
Number = _Number;
}
// This function is used to retrieve the stored Number variable
function getNumber() public view returns (uint256) {
return Number;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment