Skip to content

Instantly share code, notes, and snippets.

@DanteAlabastro
Last active October 5, 2018 05:48
Show Gist options
  • Save DanteAlabastro/424504df9aed8c8722edb752cc99d2d4 to your computer and use it in GitHub Desktop.
Save DanteAlabastro/424504df9aed8c8722edb752cc99d2d4 to your computer and use it in GitHub Desktop.
An owner lockable contract.
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