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.
39 lines
943 B
39 lines
943 B
pragma solidity ^0.4.18;
|
|
|
|
|
|
import "./Ownable.sol";
|
|
|
|
|
|
/**
|
|
* @title Claimable
|
|
* @dev Extension for the Ownable contract, where the ownership needs to be claimed.
|
|
* This allows the new owner to accept the transfer.
|
|
*/
|
|
contract Claimable is Ownable {
|
|
address public pendingOwner;
|
|
|
|
/**
|
|
* @dev Modifier throws if called by any account other than the pendingOwner.
|
|
*/
|
|
modifier onlyPendingOwner() {
|
|
require(msg.sender == pendingOwner);
|
|
_;
|
|
}
|
|
|
|
/**
|
|
* @dev Allows the current owner to set the pendingOwner address.
|
|
* @param newOwner The address to transfer ownership to.
|
|
*/
|
|
function transferOwnership(address newOwner) onlyOwner public {
|
|
pendingOwner = newOwner;
|
|
}
|
|
|
|
/**
|
|
* @dev Allows the pendingOwner address to finalize the transfer.
|
|
*/
|
|
function claimOwnership() onlyPendingOwner public {
|
|
OwnershipTransferred(owner, pendingOwner);
|
|
owner = pendingOwner;
|
|
pendingOwner = address(0);
|
|
}
|
|
}
|
|
|