Merge pull request #51 from AugustoL/master
Added Claimable contract as an extension of Ownable
This commit is contained in:
26
contracts/Claimable.sol
Normal file
26
contracts/Claimable.sol
Normal file
@ -0,0 +1,26 @@
|
||||
pragma solidity ^0.4.0;
|
||||
import './Ownable.sol';
|
||||
|
||||
/*
|
||||
* Claimable
|
||||
* Extension for the Ownable contract, where the ownership needs to be claimed
|
||||
*/
|
||||
|
||||
contract Claimable is Ownable {
|
||||
address public pendingOwner;
|
||||
|
||||
modifier onlyPendingOwner() {
|
||||
if (msg.sender == pendingOwner)
|
||||
_;
|
||||
}
|
||||
|
||||
function transfer(address newOwner) onlyOwner {
|
||||
pendingOwner = newOwner;
|
||||
}
|
||||
|
||||
function claimOwnership() onlyPendingOwner {
|
||||
owner = pendingOwner;
|
||||
pendingOwner = 0x0;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user