43 lines
898 B
Solidity
Raw Normal View History

2018-09-14 14:20:41 -04:00
pragma solidity ^0.4.24;
2017-07-16 14:11:37 -04:00
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
2018-09-14 14:20:41 -04:00
constructor() public {
2017-07-16 14:11:37 -04:00
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
if (msg.sender != owner) {
2017-10-21 15:01:09 -04:00
revert();
2017-07-16 14:11:37 -04:00
}
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
2017-10-21 15:01:09 -04:00
function transferOwnership(address newOwner) public onlyOwner {
2017-07-16 14:11:37 -04:00
if (newOwner != address(0)) {
owner = newOwner;
}
}
}