Skip to content

Instantly share code, notes, and snippets.

@Shashank-In
Created October 21, 2022 04:56
Show Gist options
  • Save Shashank-In/d8a852004b409c3af6ec42a47a443b85 to your computer and use it in GitHub Desktop.
Save Shashank-In/d8a852004b409c3af6ec42a47a443b85 to your computer and use it in GitHub Desktop.
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