Skip to content

Instantly share code, notes, and snippets.

@elenadimitrova
Last active August 10, 2016 07:10
Show Gist options
  • Save elenadimitrova/1a3293454043945f9b015d954c51d1d1 to your computer and use it in GitHub Desktop.
Save elenadimitrova/1a3293454043945f9b015d954c51d1d1 to your computer and use it in GitHub Desktop.
contract Ownable {
address public owner = msg.sender;
/// @notice check if the caller is the owner of the contract
modifier onlyOwner {
if (msg.sender != owner) throw;
_
}
/// @notice change the owner of the contract
/// @param _newOwner the address of the new owner of the contract.
function changeOwner(address _newOwner)
onlyOwner
{
if(_newOwner == 0x0) throw;
owner = _newOwner;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment