aboutsummaryrefslogblamecommitdiffstats
path: root/packages/contracts/src/1.0.0/Ownable/Ownable_v1.sol
blob: c87438fa47f172773668d10fc2a9e27d71388f3f (plain) (tree)
1
2
3
4
5
6
7
8
9








                                                                                                                    
                     

                         
                           













                                                            
pragma solidity ^0.4.11;

/*
 * Ownable
 *
 * Base contract with an owner.
 * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.
 */

contract Ownable_v1 {
    address public owner;

    function Ownable_v1() {
        owner = msg.sender;
    }

    modifier onlyOwner() {
        require(msg.sender == owner);
        _;
    }

    function transferOwnership(address newOwner) onlyOwner {
        if (newOwner != address(0)) {
            owner = newOwner;
        }
    }
}