aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src/current/utils/Ownable/Ownable.sol
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-02-06 05:16:46 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-02-06 05:16:46 +0800
commit99b1f81e89e3ac929c7829552ea7ae19998524e9 (patch)
tree534161a9fa8bcf8bb5572d7ef0aa311fe9b9d116 /packages/contracts/src/current/utils/Ownable/Ownable.sol
parent6577d607332e2fb1a442d663e260ecb969457c36 (diff)
parent46ad7b1b38df0f302821258629ffa749e7dd00b9 (diff)
downloaddexon-sol-tools-99b1f81e89e3ac929c7829552ea7ae19998524e9.tar
dexon-sol-tools-99b1f81e89e3ac929c7829552ea7ae19998524e9.tar.gz
dexon-sol-tools-99b1f81e89e3ac929c7829552ea7ae19998524e9.tar.bz2
dexon-sol-tools-99b1f81e89e3ac929c7829552ea7ae19998524e9.tar.lz
dexon-sol-tools-99b1f81e89e3ac929c7829552ea7ae19998524e9.tar.xz
dexon-sol-tools-99b1f81e89e3ac929c7829552ea7ae19998524e9.tar.zst
dexon-sol-tools-99b1f81e89e3ac929c7829552ea7ae19998524e9.zip
Merge branch 'development' into feature/testnet-faucets/order-dispenser
* development: (37 commits) Add dates to CHANGELOGs Change CHANGELOGs Add .editorconfig Fix a typo Temp Use forEach instead of map Add PR number Fix an exception when a signature collision happens Fix prettier Add regression tests Improve the comment and fix an exception Add missing comas Lerna-ignore tslint and tsconfig Update contract versions, fix tests Rename directories Rename previous contracts, fix imports, add nested file structure Move all contracts into a single directory Update import Fix import Get rid of suffixed contract versioning and replace it with a poor-mans package manager. Versions are stored locally, and are generated in a copy-on-write basis as required ...
Diffstat (limited to 'packages/contracts/src/current/utils/Ownable/Ownable.sol')
-rw-r--r--packages/contracts/src/current/utils/Ownable/Ownable.sol32
1 files changed, 32 insertions, 0 deletions
diff --git a/packages/contracts/src/current/utils/Ownable/Ownable.sol b/packages/contracts/src/current/utils/Ownable/Ownable.sol
new file mode 100644
index 000000000..9b3d6b9cf
--- /dev/null
+++ b/packages/contracts/src/current/utils/Ownable/Ownable.sol
@@ -0,0 +1,32 @@
+pragma solidity ^0.4.18;
+
+/*
+ * 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()
+ public
+ {
+ owner = msg.sender;
+ }
+
+ modifier onlyOwner() {
+ require(msg.sender == owner);
+ _;
+ }
+
+ function transferOwnership(address newOwner)
+ public
+ onlyOwner
+ {
+ if (newOwner != address(0)) {
+ owner = newOwner;
+ }
+ }
+}