solidity/test/compilationTests/corion/owned.sol

29 lines
657 B
Solidity
Raw Normal View History

2017-07-05 10:28:15 +00:00
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;
}
}