Course lesson
Create a Smart Contract Function that Transfers eth from One Address to Another
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...
- Duration
- 3 min
- Access
- Included
- Transcript
- Retained from source evidence
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