-
-
Save DerayGa/28e6658689243f2797f5f291fd1e1411 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; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment