Last active
October 29, 2021 14:37
-
-
Save haniefhan/6fe007f041954d28871f7437b90e6d96 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 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