Created
March 6, 2022 00:53
-
-
Save halienm/a48fb905c807fd52e258433ec4681238 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=0.8.13&optimize=true&runs=200&gist=
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
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.6.2 <0.9.0; | |
// THIS CONTRACT CONTAINS A BUG - DO NOT USE | |
contract Fund { | |
/// @dev Mapping of ether shares of the contract. | |
mapping(address => uint) shares; | |
/// Withdraw your share. | |
function withdraw() public { | |
(bool success,) = msg.sender.call{value: shares[msg.sender]}(""); | |
if (success) | |
shares[msg.sender] = 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment