Created
October 22, 2016 05:55
-
-
Save noeleon930/21d2b64749450ba3fcb91f0b8dc62dc7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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.0; | |
| // THIS CONTRACT CONTAINS A BUG - DO NOT USE | |
| contract Fund { | |
| /// Mapping of ether shares of the contract. | |
| mapping(address => uint) shares; | |
| /// Withdraw your share. | |
| function withdraw() { | |
| if (msg.sender.send(shares[msg.sender])) | |
| shares[msg.sender] = 0; | |
| } | |
| } | |
| contract Fund2 { | |
| /// Mapping of ether shares of the contract. | |
| mapping(address => uint) shares; | |
| /// Withdraw your share. | |
| function withdraw() { | |
| var share = shares[msg.sender]; | |
| shares[msg.sender] = 0; | |
| if (!msg.sender.send(share)) | |
| throw; | |
| } | |
| } |
Author
noeleon930
commented
Mar 20, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment