Created
January 15, 2018 15:13
-
-
Save nareddyt/07eb71a9b7e5321918699b1270b779b4 to your computer and use it in GitHub Desktop.
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.19; | |
// Note that anyone can stop this contract from running! | |
// Only owner can restart it :) | |
contract PubliclyStoppable { | |
address public owner; | |
bool public stopped; | |
function PubliclyStoppable() public { | |
owner = msg.sender; | |
stopped = false; | |
} | |
modifier stopInEmergency { | |
require(!stopped); | |
_; | |
} | |
modifier onlyInEmergency { | |
require(stopped); | |
require(msg.sender == owner); | |
_; | |
} | |
function stop() external stopInEmergency { | |
stopped = true; | |
} | |
function start() external onlyInEmergency { | |
stopped = false; | |
} | |
} | |
contract TestNodeDDOS is PubliclyStoppable { | |
function loop1() public stopInEmergency constant returns (uint256) { | |
while (!stopped) { | |
uint256 temp = 1; | |
} | |
return 1; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://rinkeby.etherscan.io/address/0x96c80720bb467b759d7b78a09b1f2579eafd2991#code