foolsgrans/contracts/Owned.sol

25 lines
598 B
Solidity

// SPDX-License-Identifier: Proprietary
pragma solidity ^0.8.0;
contract Owned {
address public contractOwner;
event OwnershipTransferred(
address indexed from,
address indexed to
);
modifier onlyContractOwner {
require(contractOwner == msg.sender, "Not owner");
_;
}
function setContractOwner(address newContractOwner) public onlyContractOwner {
require(newContractOwner != address(0), "0 owner disallowed");
emit OwnershipTransferred(contractOwner, newContractOwner);
contractOwner = newContractOwner;
}
}