From ac84b36144f746662e5ddb984d283e053c7d06ba Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 5 Jul 2017 12:28:15 +0200 Subject: Added various contracts for testing. --- .../zeppelin/ownership/Ownable.sol | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 test/compilationTests/zeppelin/ownership/Ownable.sol (limited to 'test/compilationTests/zeppelin/ownership/Ownable.sol') diff --git a/test/compilationTests/zeppelin/ownership/Ownable.sol b/test/compilationTests/zeppelin/ownership/Ownable.sol new file mode 100644 index 00000000..f1628454 --- /dev/null +++ b/test/compilationTests/zeppelin/ownership/Ownable.sol @@ -0,0 +1,43 @@ +pragma solidity ^0.4.11; + + +/** + * @title Ownable + * @dev The Ownable contract has an owner address, and provides basic authorization control + * functions, this simplifies the implementation of "user permissions". + */ +contract Ownable { + address public owner; + + + /** + * @dev The Ownable constructor sets the original `owner` of the contract to the sender + * account. + */ + function Ownable() { + owner = msg.sender; + } + + + /** + * @dev Throws if called by any account other than the owner. + */ + modifier onlyOwner() { + if (msg.sender != owner) { + throw; + } + _; + } + + + /** + * @dev Allows the current owner to transfer control of the contract to a newOwner. + * @param newOwner The address to transfer ownership to. + */ + function transferOwnership(address newOwner) onlyOwner { + if (newOwner != address(0)) { + owner = newOwner; + } + } + +} -- cgit v1.2.3