Skip to content

Instantly share code, notes, and snippets.

@devonwesley
Created October 8, 2017 21:02
Show Gist options
  • Save devonwesley/cd8c8dfa2e9cd3bb8bd98ab8a20e8412 to your computer and use it in GitHub Desktop.
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).
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