Created
October 8, 2017 21:02
-
-
Save devonwesley/cd8c8dfa2e9cd3bb8bd98ab8a20e8412 to your computer and use it in GitHub Desktop.
A Ethereum contract with the "Reentrancy" vulnerability (DO NOT DEPLOY, for demonstration only).
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.8; | |
contract Victim { | |
function withdraw() { | |
uint transferAmt = 1 ether; | |
if (!msg.sender.call.value(transferAmt)()) throw; | |
} | |
function deposit() payable {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment