Created
March 27, 2020 17:38
-
-
Save johnsoncarl/49c5c111a46b3f615fde4f4602586d7b to your computer and use it in GitHub Desktop.
For Day14 blog of 20 Days blog series.
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