aboutsummaryrefslogblamecommitdiffstats
path: root/packages/contracts/src/2.0.0/utils/Ownable/Ownable.sol
blob: 0c830be685e5f584fa3cc3402247f2fc01e2afdf (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                       
 
                        
 
 


                   

                         
                  





                           

                                
                                 
          




                                                
                 





                                     
pragma solidity 0.4.24;

import "./IOwnable.sol";


contract Ownable is
    IOwnable
{
    address public owner;

    constructor ()
        public
    {
        owner = msg.sender;
    }

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

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