Skip to content

Instantly share code, notes, and snippets.

@stefan2904
Last active August 11, 2020 12:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stefan2904/848468ad9314c453205d3289600bba0b to your computer and use it in GitHub Desktop.
Save stefan2904/848468ad9314c453205d3289600bba0b to your computer and use it in GitHub Desktop.
Some demo Smart Contract (deploy via https://remix.ethereum.org)
pragma solidity >=0.4.22 <0.7.0;
/**
* @title VerrStorage
* @dev Store & retreive value in a variable
*/
contract VerrStorage {
address payable public owner = msg.sender;
uint public creationTime = block.timestamp;
uint256 number;
/**
* @dev Store value in variable
* @param num value to store
*/
function store2(uint256 num) public {
number = num;
}
/**
* @dev Return value
* @return value of 'number'
*/
function retreive() public view returns (uint256){
return number;
}
function kill() public {
if (msg.sender == owner)
selfdestruct(owner);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment