aboutsummaryrefslogtreecommitdiffstats
path: root/test/compilationTests/corion/owned.sol
blob: bd187775031b38a8041961a8348fef95db9b987e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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;
    }
}