* Update to ganache-cli v6.1.0 and truffle v4.1.0 * Update to stable version of ganache-cli * fix: update event emission warning - Fix event emission warnings for solidity 4.21 after truffle has been updated to use this version * fix pr review comments * update to truffle v4.1.5 * update package-lock * add additional emit keywords * update solidity-coverage to 0.4.15 * update to solium 1.1.6 * fix MerkleProof coverage analysis by testing through wrapper * change version pragma to ^0.4.21 * fix solium linting errors
40 lines
948 B
Solidity
40 lines
948 B
Solidity
pragma solidity ^0.4.21;
|
|
|
|
|
|
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 {
|
|
emit OwnershipTransferred(owner, pendingOwner);
|
|
owner = pendingOwner;
|
|
pendingOwner = address(0);
|
|
}
|
|
}
|