Last active
June 15, 2018 15:17
-
-
Save boxfox619/d89e27054c9c10e1ebf955ed7eb9128c to your computer and use it in GitHub Desktop.
Solidity Example
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
contract Sample | |
{ | |
uint data; | |
address owner; | |
event logData(uint256 dataToLog); | |
modifier onlyOwner() { | |
if (msg.sender != owner) throw; | |
_; | |
} | |
function Sample(uint256 initData, address initOwner){ | |
data = initData; | |
owner = initOwner; | |
} | |
function getData() returns (uint256 returnedData){ | |
return data; | |
} | |
function setData(uint256 newData) onlyOwner{ | |
logData(newData); | |
data = newData; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment