aboutsummaryrefslogtreecommitdiffstats
path: root/packages/deployer/test/fixtures/contracts/base/Ownable.sol
diff options
context:
space:
mode:
Diffstat (limited to 'packages/deployer/test/fixtures/contracts/base/Ownable.sol')
-rw-r--r--packages/deployer/test/fixtures/contracts/base/Ownable.sol27
1 files changed, 27 insertions, 0 deletions
diff --git a/packages/deployer/test/fixtures/contracts/base/Ownable.sol b/packages/deployer/test/fixtures/contracts/base/Ownable.sol
new file mode 100644
index 000000000..2a74c3717
--- /dev/null
+++ b/packages/deployer/test/fixtures/contracts/base/Ownable.sol
@@ -0,0 +1,27 @@
+pragma solidity 0.4.14;
+
+/*
+ * Ownable
+ *
+ * Base contract with an owner.
+ * Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.
+ */
+
+contract Ownable {
+ address public owner;
+
+ function Ownable() {
+ owner = msg.sender;
+ }
+
+ modifier onlyOwner() {
+ require(msg.sender == owner);
+ _;
+ }
+
+ function transferOwnership(address newOwner) onlyOwner {
+ if (newOwner != address(0)) {
+ owner = newOwner;
+ }
+ }
+}