Created
October 21, 2022 04:56
-
-
Save Shashank-In/d8a852004b409c3af6ec42a47a443b85 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
contract fallbackVulnerability { | |
mapping (address => uint) private balances; | |
function addAllMoney (address Useraccount) public payable { | |
balances [Useraccount] = msg.value; | |
} | |
function withdrawAllMoney (uint Totalamount) public { | |
if (balances [msg.sender]>= Totalamount) { | |
msg.sender.call.value(Totalamount)(""); | |
balances [msg.sender] -= Totalamount; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment