Claimable.sol 567 B

12345678910111213141516171819202122232425262728293031
  1. pragma solidity ^0.4.8;
  2. import './Ownable.sol';
  3. /*
  4. * Claimable
  5. *
  6. * Extension for the Ownable contract, where the ownership needs to be claimed. This allows the new owner to accept the transfer.
  7. */
  8. contract Claimable is Ownable {
  9. address public pendingOwner;
  10. modifier onlyPendingOwner() {
  11. if (msg.sender != pendingOwner) {
  12. throw;
  13. }
  14. _;
  15. }
  16. function transferOwnership(address newOwner) onlyOwner {
  17. pendingOwner = newOwner;
  18. }
  19. function claimOwnership() onlyPendingOwner {
  20. owner = pendingOwner;
  21. pendingOwner = 0x0;
  22. }
  23. }