aboutsummaryrefslogtreecommitdiffstats
path: root/test/compilationTests/corion/owned.sol
diff options
context:
space:
mode:
Diffstat (limited to 'test/compilationTests/corion/owned.sol')
-rw-r--r--test/compilationTests/corion/owned.sol28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/compilationTests/corion/owned.sol b/test/compilationTests/corion/owned.sol
new file mode 100644
index 00000000..bd187775
--- /dev/null
+++ b/test/compilationTests/corion/owned.sol
@@ -0,0 +1,28 @@
+pragma solidity ^0.4.11;
+
+contract ownedDB {
+ address private owner;
+
+ function replaceOwner(address newOwner) external returns(bool) {
+ /*
+ Owner replace.
+
+ @newOwner Address of new owner.
+ */
+ require( isOwner() );
+ owner = newOwner;
+ return true;
+ }
+
+ function isOwner() internal returns(bool) {
+ /*
+ Check of owner address.
+
+ @bool Owner has called the contract or not
+ */
+ if ( owner == 0x00 ) {
+ return true;
+ }
+ return owner == msg.sender;
+ }
+}