You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
789 B
31 lines
789 B
8 years ago
|
pragma solidity ^0.4.4;
|
||
|
import './Ownable.sol';
|
||
|
import './Claimable.sol';
|
||
|
|
||
|
/*
|
||
|
* DelayedClaimable
|
||
8 years ago
|
* Extension for the Claimable contract, where the ownership needs to be claimed before/after certain block number
|
||
8 years ago
|
*/
|
||
|
|
||
|
contract DelayedClaimable is Ownable, Claimable {
|
||
8 years ago
|
|
||
8 years ago
|
uint public claimBeforeBlock;
|
||
8 years ago
|
uint public claimAfterBlock;
|
||
8 years ago
|
|
||
8 years ago
|
function setClaimBlocks(uint _claimBeforeBlock, uint _claimAfterBlock) onlyOwner {
|
||
|
if (_claimAfterBlock > claimBeforeBlock)
|
||
|
throw;
|
||
8 years ago
|
claimBeforeBlock = _claimBeforeBlock;
|
||
8 years ago
|
claimAfterBlock = _claimAfterBlock;
|
||
8 years ago
|
}
|
||
|
|
||
8 years ago
|
function claimOwnership() onlyPendingOwner {
|
||
8 years ago
|
if ((block.number > claimBeforeBlock) || (block.number < claimAfterBlock))
|
||
|
throw;
|
||
8 years ago
|
owner = pendingOwner;
|
||
|
pendingOwner = 0x0;
|
||
8 years ago
|
claimBeforeBlock = 0;
|
||
8 years ago
|
}
|
||
|
|
||
|
}
|