Created
September 16, 2021 12:36
-
-
Save nathan-websculpt/7d03c792f752d22b6633a58e08128fb4 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
function withdrawFromAttackee() public { | |
uint senderBalance = attackeeBalances[msg.sender]; | |
require(senderBalance > 0); | |
(bool success, ) = msg.sender.call{ value: senderBalance }(""); | |
require(success, "withdrawFromAttackee failed to send"); | |
attackeeBalances[msg.sender] = 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Used as an example in This Blog Post