-
-
Save kadenzipfel/a3ccdd3d11160165770615213c83a232 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
// 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