It's time to add functionality to our smart contract. In this lesson we will define a function sendTip
that accepts a _message
and _name
. We will check the senders balance and if it's higher than the tip amount transer the eth specified. We will also increment our totalTips
contract variable and add the tip to our Tips array.
While adding this function you'll learn how to handle errors within Solidity functions