Skip to content

Instantly share code, notes, and snippets.

@johnsoncarl
Created May 26, 2019 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnsoncarl/8a4659e504a09dbd0366038aa6e11a0b to your computer and use it in GitHub Desktop.
Save johnsoncarl/8a4659e504a09dbd0366038aa6e11a0b to your computer and use it in GitHub Desktop.
contract attacker{
bool public flag=false;
function change() public{
if(!flag) flag=true;
else flag=false;
}
function() external payable {
if(flag) revert();
}
}
contract Test{
attacker a = new attacker();
bool private flag0 = true;
bool private status;
function set0(int val) public returns (bool){
if (val % 10 == 0) {a.change();}
else flag0=false;
}
function echidna_send() public payable returns(bool){
address(this).transfer(msg.value);
return address(a).send(0);
}
function() external payable{}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment