Skip to content

Instantly share code, notes, and snippets.

@kadenzipfel
Created December 3, 2019 19:33
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 kadenzipfel/a3ccdd3d11160165770615213c83a232 to your computer and use it in GitHub Desktop.
Save kadenzipfel/a3ccdd3d11160165770615213c83a232 to your computer and use it in GitHub Desktop.
// 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