foolsgrans/contracts/Owned.sol

25 lines
598 B
Solidity
Raw Normal View History

2021-01-10 12:14:05 +00:00
// 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;
}
}