Last active
October 5, 2018 05:48
-
-
Save DanteAlabastro/424504df9aed8c8722edb752cc99d2d4 to your computer and use it in GitHub Desktop.
An owner lockable contract.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.21; | |
contract OnOff{ | |
bool public kill_switch = false; | |
address Owner = msg.sender; | |
modifier IsOwner(){ | |
require(msg.sender == Owner); | |
_; | |
} | |
modifier checkLock(){ | |
require(kill_switch == false); | |
_; | |
} | |
function toggle(bool On_Off) external IsOwner{ | |
kill_switch = On_Off; | |
} | |
function message() public view checkLock returns(string){ | |
return("Hello, we are open for business!"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment