pragma solidity ^0.4.17; // represents a contract which is owned contract Owned { // contract owner address private owner; event NotAuthorized(address addr); // constructor function Owned() public { owner = msg.sender; } // returns the contract's owner function getOwner() public view returns (address) { return owner; } // gives the ability to restrict a // function access to the contract owner modifier restricted() { if (msg.sender == owner) { _; } else { NotAuthorized(msg.sender); } } }