Skip to content

Instantly share code, notes, and snippets.

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