Ownable.sol 476 B

1234567891011121314151617181920212223242526
  1. pragma solidity ^0.4.4;
  2. /*
  3. * Ownable
  4. *
  5. * Base contract with an owner.
  6. * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.
  7. */
  8. contract Ownable {
  9. address public owner;
  10. function Ownable() {
  11. owner = msg.sender;
  12. }
  13. modifier onlyOwner() {
  14. if (msg.sender == owner)
  15. _;
  16. }
  17. function transferOwnership(address newOwner) onlyOwner {
  18. if (newOwner != address(0)) owner = newOwner;
  19. }
  20. }