Ownable.sol 866 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. pragma solidity ^0.4.11;
  2. /**
  3. * @title Ownable
  4. * @dev The Ownable contract has an owner address, and provides basic authorization control
  5. * functions, this simplifies the implementation of "user permissions".
  6. */
  7. contract Ownable {
  8. address public owner;
  9. /**
  10. * @dev The Ownable constructor sets the original `owner` of the contract to the sender
  11. * account.
  12. */
  13. function Ownable() {
  14. owner = msg.sender;
  15. }
  16. /**
  17. * @dev Throws if called by any account other than the owner.
  18. */
  19. modifier onlyOwner() {
  20. require(msg.sender == owner);
  21. _;
  22. }
  23. /**
  24. * @dev Allows the current owner to transfer control of the contract to a newOwner.
  25. * @param newOwner The address to transfer ownership to.
  26. */
  27. function transferOwnership(address newOwner) onlyOwner {
  28. if (newOwner != address(0)) {
  29. owner = newOwner;
  30. }
  31. }
  32. }