Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// INSECURE
contract Auction {
address currentLeader;
uint highestBid;
function bid() payable {
require(msg.value > highestBid);
require(currentLeader.send(highestBid)); // Refund the old leader, if it fails then revert
currentLeader = msg.sender;
highestBid = msg.value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment