Skip to content

Instantly share code, notes, and snippets.

Last active October 28, 2022 08:04
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
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