Claimable.sol 990 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. pragma solidity ^0.4.8;
  2. import './Ownable.sol';
  3. /**
  4. * @title Claimable
  5. * @dev Extension for the Ownable contract, where the ownership needs to be claimed.
  6. * This allows the new owner to accept the transfer.
  7. */
  8. contract Claimable is Ownable {
  9. address public pendingOwner;
  10. /**
  11. * @dev The onlyPendingOwner modifier throws if called by any account other than the
  12. * pendingOwner.
  13. */
  14. modifier onlyPendingOwner() {
  15. if (msg.sender != pendingOwner) {
  16. throw;
  17. }
  18. _;
  19. }
  20. /**
  21. * @dev The transferOwnership function allows the current owner to set the pendingOwner
  22. * address.
  23. * @param pendingOwner The address to transfer ownership to.
  24. */
  25. function transferOwnership(address newOwner) onlyOwner {
  26. pendingOwner = newOwner;
  27. }
  28. /**
  29. * @dev The claimOwnership function allows the pendingOwner address to finalize the transfer.
  30. */
  31. function claimOwnership() onlyPendingOwner {
  32. owner = pendingOwner;
  33. pendingOwner = 0x0;
  34. }
  35. }