forked from GeensNPO/gee-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ownable.sol
40 lines (31 loc) · 893 Bytes
/
Ownable.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
pragma solidity ^0.4.16;
/**
* @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 owner;
event OwnershipTransferred(address indexed _previousOwner, address indexed _newOwner);
function Ownable() {
owner = msg.sender;
OwnershipTransferred (address(0), owner);
}
function transferOwnership(address _newOwner)
public
onlyOwner
notZeroAddress(_newOwner)
{
owner = _newOwner;
OwnershipTransferred(msg.sender, _newOwner);
}
//Only owner can call function
modifier onlyOwner {
require(msg.sender == owner);
_;
}
modifier notZeroAddress(address _address) {
require(_address != address(0));
_;
}
}