Skip to content

Instantly share code, notes, and snippets.

@haniefhan
Created October 29, 2021 10:02
Show Gist options
  • Save haniefhan/4f1b35f3945a901330e383a9eed098c2 to your computer and use it in GitHub Desktop.
Save haniefhan/4f1b35f3945a901330e383a9eed098c2 to your computer and use it in GitHub Desktop.
...
contract SmartBank {
...
function withdraw(uint amount) public {
require(amount <= balances[msg.sender], "Your balance is not enough!");
payable(msg.sender).transfer(amount);
balances[msg.sender] -= amount;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment