DelayedClaimable.sol 575 B

12345678910111213141516171819202122232425262728
  1. pragma solidity ^0.4.4;
  2. import './Ownable.sol';
  3. import './Claimable.sol';
  4. /*
  5. * DelayedClaimable
  6. * Extension for the Claimable contract, where the ownership needs to be claimed before certain time
  7. */
  8. contract DelayedClaimable is Ownable, Claimable {
  9. uint public claimBefore;
  10. modifier onTime() {
  11. if (block.number < claimBefore)
  12. _;
  13. }
  14. function setDelay(uint _claimBefore) onlyOwner {
  15. claimBefore = _claimBefore;
  16. }
  17. function claimOwnership() onlyPendingOwner onTime {
  18. owner = pendingOwner;
  19. pendingOwner = 0x0;
  20. claimBefore = 0;
  21. }
  22. }