Last active
June 20, 2018 12:08
-
-
Save JoshBroomberg/e00c99a65132243bfbd7ea91e57f494b to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
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.16; | |
contract Ownable { | |
address public owner; | |
constructor () public { | |
owner = msg.sender; | |
} | |
modifier onlyOwner(){ | |
require (msg.sender == owner); | |
_; | |
} | |
} | |
contract IXMessages is Ownable { | |
mapping (address => string) private messages; | |
constructor () public {} | |
function addMessage(address recipient, string message) public onlyOwner { | |
messages[recipient] = message; | |
} | |
function getMessage() public view returns (string) { | |
return messages[msg.sender]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment