Skip to content

Instantly share code, notes, and snippets.

@jbaylina
Created July 8, 2017 23:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbaylina/9b2cd1e40db07e830d08c0140e9eac14 to your computer and use it in GitHub Desktop.
Save jbaylina/9b2cd1e40db07e830d08c0140e9eac14 to your computer and use it in GitHub Desktop.
contract Owned {
function Owned() {
owner = msg.sender;
}
address public owner;
// This contract only defines a modifier and a few useful functions
// The function body is inserted where the special symbol "_" in the
// definition of a modifier appears.
modifier onlyOwner { if (msg.sender == owner) _; }
function changeOwner(address _newOwner) onlyOwner {
owner = _newOwner;
}
// This is a general safty function that allows the owner to do a lot
// of things in the unlikely event that something goes wrong
// _dst is the contract being called making this like a 1/1 multisig
function execute(address _dst, uint _value, bytes _data) onlyOwner {
_dst.call.value(_value)(_data);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment