diff options
author | Leonid <logvinov.leon@gmail.com> | 2018-02-05 19:33:40 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-05 19:33:40 +0800 |
commit | 7b4f2b47de393b7ed6d5c264c8e80864d196180c (patch) | |
tree | 8e86af8000e0aedd7241a00c2189d8f7ca0fc2ad /packages/contracts/src/current/utils/Ownable | |
parent | 400a97e7a8f76d894d47368425bbe1e33fa5b255 (diff) | |
parent | c7ad6ebad6ab65a4b1e4a2084e744c6ca2bc09b8 (diff) | |
download | dexon-sol-tools-7b4f2b47de393b7ed6d5c264c8e80864d196180c.tar dexon-sol-tools-7b4f2b47de393b7ed6d5c264c8e80864d196180c.tar.gz dexon-sol-tools-7b4f2b47de393b7ed6d5c264c8e80864d196180c.tar.bz2 dexon-sol-tools-7b4f2b47de393b7ed6d5c264c8e80864d196180c.tar.lz dexon-sol-tools-7b4f2b47de393b7ed6d5c264c8e80864d196180c.tar.xz dexon-sol-tools-7b4f2b47de393b7ed6d5c264c8e80864d196180c.tar.zst dexon-sol-tools-7b4f2b47de393b7ed6d5c264c8e80864d196180c.zip |
Merge branch 'development' into fix/ether_token_address
Diffstat (limited to 'packages/contracts/src/current/utils/Ownable')
-rw-r--r-- | packages/contracts/src/current/utils/Ownable/Ownable.sol | 32 |
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; + } + } +} |