Created
May 26, 2019 16:18
-
-
Save johnsoncarl/8a4659e504a09dbd0366038aa6e11a0b 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
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