Skip to content

Instantly share code, notes, and snippets.

@gakonst
Last active November 16, 2017 08:12
Show Gist options
  • Select an option

  • Save gakonst/295ba4191c87762ae49ba888fb52a1ff to your computer and use it in GitHub Desktop.

Select an option

Save gakonst/295ba4191c87762ae49ba888fb52a1ff to your computer and use it in GitHub Desktop.
function withdraw(uint _amount) public {
if(balances[msg.sender] >= _amount) {
if(msg.sender.call.value(_amount)()) {
_amount;
}
balances[msg.sender] -= _amount;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment