2017-07-05 10:28:15 +00:00
|
|
|
pragma solidity ^0.4.11;
|
|
|
|
|
|
|
|
|
|
|
|
import './Ownable.sol';
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @title Claimable
|
2018-08-01 19:57:12 +00:00
|
|
|
* @dev Extension for the Ownable contract, where the ownership needs to be claimed.
|
2017-07-05 10:28:15 +00:00
|
|
|
* This allows the new owner to accept the transfer.
|
|
|
|
*/
|
|
|
|
contract Claimable is Ownable {
|
2018-09-12 14:21:43 +00:00
|
|
|
address payable public pendingOwner;
|
2017-07-05 10:28:15 +00:00
|
|
|
|
|
|
|
/**
|
2018-08-01 19:57:12 +00:00
|
|
|
* @dev Modifier throws if called by any account other than the pendingOwner.
|
2017-07-05 10:28:15 +00:00
|
|
|
*/
|
|
|
|
modifier onlyPendingOwner() {
|
|
|
|
if (msg.sender != pendingOwner) {
|
2018-07-11 23:49:00 +00:00
|
|
|
revert();
|
2017-07-05 10:28:15 +00:00
|
|
|
}
|
|
|
|
_;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2018-08-01 19:57:12 +00:00
|
|
|
* @dev Allows the current owner to set the pendingOwner address.
|
|
|
|
* @param newOwner The address to transfer ownership to.
|
2017-07-05 10:28:15 +00:00
|
|
|
*/
|
2018-09-12 14:21:43 +00:00
|
|
|
function transferOwnership(address payable newOwner) public onlyOwner {
|
2017-07-05 10:28:15 +00:00
|
|
|
pendingOwner = newOwner;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dev Allows the pendingOwner address to finalize the transfer.
|
|
|
|
*/
|
2018-07-04 17:20:51 +00:00
|
|
|
function claimOwnership() public onlyPendingOwner {
|
2017-07-05 10:28:15 +00:00
|
|
|
owner = pendingOwner;
|
2018-06-12 09:05:49 +00:00
|
|
|
pendingOwner = address(0x0);
|
2017-07-05 10:28:15 +00:00
|
|
|
}
|
|
|
|
}
|