DelayedClaimable.sol 628 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 block number
  7. */
  8. contract DelayedClaimable is Ownable, Claimable {
  9. uint public claimBeforeBlock;
  10. modifier claimBefore() {
  11. if (block.number < claimBeforeBlock)
  12. _;
  13. }
  14. function setClaimBefore(uint _claimBeforeBlock) onlyOwner {
  15. claimBeforeBlock = _claimBeforeBlock;
  16. }
  17. function claimOwnership() onlyPendingOwner claimBefore {
  18. owner = pendingOwner;
  19. pendingOwner = 0x0;
  20. claimBeforeBlock = 0;
  21. }
  22. }