Created
June 28, 2018 12:54
-
-
Save rezamt/b04b965a29be46bc58ddbabf9cebaf93 to your computer and use it in GitHub Desktop.
Incrementer Smart Contract
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.24; | |
contract Incrementer { | |
address creator; | |
uint iteration; | |
function Incrementer() public | |
{ | |
creator = msg.sender; | |
iteration = 0; | |
} | |
function Increment() public | |
{ | |
iteration = iteration + 1; | |
} | |
function getIteration() public view returns (uint) | |
{ | |
return iteration; | |
} | |
function kill() public | |
{ | |
if (msg.sender == creator) | |
selfdestruct(creator); // kills this contract and sends remaining funds back to creator | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment