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
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; | |
} |
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
function sendViaCall(address payable _to) public payable { | |
(bool sent, bytes memory data) = _to.call{value:msg.value}(""); | |
require(sent, "Failed to send Ether"); | |
} |
NewerOlder