Created
October 12, 2016 20:41
-
-
Save blackyblack/2011426055f7a707b53de628579db7c5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/* A contract to store only messages sent by owner */ | |
/* Deployment: | |
Owner: 0xeb5fa6cbf2aca03a0df228f2df67229e2d3bd01e | |
Last address: TBD | |
ABI: [{"constant":false,"inputs":[{"name":"_dataInfo","type":"string"},{"name":"_version","type":"uint256"}],"name":"add","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"kill","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"contentCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"inputs":[],"type":"constructor"},{"payable":false,"type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"dataInfo","type":"string"},{"indexed":true,"name":"version","type":"uint256"}],"name":"LogMessage","type":"event"}] | |
Optimized: yes | |
Solidity version: v0.4.3-nightly.2016-10-11 | |
*/ | |
pragma solidity ^0.4.0; | |
contract SelfStore { | |
address private owner; | |
uint public contentCount = 0; | |
event LogMessage(string dataInfo, uint indexed version); | |
modifier onlyOwner { | |
if (msg.sender != owner) | |
throw; | |
_; | |
} | |
function SelfStore() { owner = msg.sender; } | |
function kill() onlyOwner { suicide(owner); } | |
function add(string _dataInfo, uint _version) onlyOwner { | |
contentCount++; | |
LogMessage(_dataInfo, _version); | |
} | |
function () { | |
throw; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment