Guest User

Untitled

a guest
Apr 27th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. contract Ownable {
  2. address public owner;
  3.  
  4. // Sets the sender address as the `owner`.
  5. function Ownable() internal {
  6. owner = msg.sender;
  7. }
  8.  
  9. // Throws an exception if called by any account other than the `owner`.
  10. modifier onlyOwner() {
  11. require(msg.sender == owner);
  12. _;
  13. }
  14. }
  15.  
  16. import './Ownable.sol';
  17.  
  18. contract MyContract is Ownable {
  19. function start() external onlyOwner {
  20. ...
  21. }
  22.  
  23. function stop() external onlyOwner {
  24. ...
  25. }
  26. }
Add Comment
Please, Sign In to add comment