DelayedClaimable.sol 789 B

123456789101112131415161718192021222324252627282930
  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/after certain block number
  7. */
  8. contract DelayedClaimable is Ownable, Claimable {
  9. uint public claimBeforeBlock;
  10. uint public claimAfterBlock;
  11. function setClaimBlocks(uint _claimBeforeBlock, uint _claimAfterBlock) onlyOwner {
  12. if (_claimAfterBlock > claimBeforeBlock)
  13. throw;
  14. claimBeforeBlock = _claimBeforeBlock;
  15. claimAfterBlock = _claimAfterBlock;
  16. }
  17. function claimOwnership() onlyPendingOwner {
  18. if ((block.number > claimBeforeBlock) || (block.number < claimAfterBlock))
  19. throw;
  20. owner = pendingOwner;
  21. pendingOwner = 0x0;
  22. claimBeforeBlock = 0;
  23. }
  24. }