diff options
author | Fabio Berger <me@fabioberger.com> | 2018-01-19 23:13:31 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-02-03 01:39:08 +0800 |
commit | 2721252d6a82e83801c650ebad6a2cb4d7195bc1 (patch) | |
tree | c22be8b830f57e8984be92d6936f5fefc9c44c2d /packages/contracts/contracts_old/Ownable | |
parent | 47d74aa24ac06de33ae331f3589e9c8013c655ec (diff) | |
download | dexon-0x-contracts-2721252d6a82e83801c650ebad6a2cb4d7195bc1.tar.gz dexon-0x-contracts-2721252d6a82e83801c650ebad6a2cb4d7195bc1.tar.zst dexon-0x-contracts-2721252d6a82e83801c650ebad6a2cb4d7195bc1.zip |
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/contracts_old/Ownable')
-rw-r--r-- | packages/contracts/contracts_old/Ownable/v1.sol | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/packages/contracts/contracts_old/Ownable/v1.sol b/packages/contracts/contracts_old/Ownable/v1.sol new file mode 100644 index 000000000..5488896d7 --- /dev/null +++ b/packages/contracts/contracts_old/Ownable/v1.sol @@ -0,0 +1,27 @@ +pragma solidity ^0.4.11; + +/* + * 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; + } + } +} |