Created
July 21, 2018 18:46
-
-
Save vasa-develop/8872b02608ead7c8ae233d96c8aafe7e to your computer and use it in GitHub Desktop.
DO NOT USE THIS CODE. THIS CODE IS USED TO DEMONSTRATE A VULNERABILITY IN A SOLIDITY CODE.
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
contract Lotto { | |
bool public payedOut = false; | |
address public winner; | |
uint public winAmount; | |
// ... extra functionality here | |
function sendToWinner() public { | |
require(!payedOut); | |
winner.send(winAmount); | |
payedOut = true; | |
} | |
function withdrawLeftOver() public { | |
require(payedOut); | |
msg.sender.send(this.balance); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment