From the course: Blockchain: Learning Solidity
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Finalize the functions
From the course: Blockchain: Learning Solidity
Finalize the functions
- [Instructor] So let's finalize our functions of our contract. So below the modifier and the conditionals we're going to start by writing our first function. And again, you declare function by saying function. And what we're going to do is write the first function, declareDeceased, I know it's morbid as an example but this is going with the example that we've set earlier in our little examples in the first few videos. external onlyOwner. So basically, right now, we're declaring that the person is deceased, therefore the person can actually receive the amount that was set in the contract and therefore execute the contract. So we require, first of all, that isOwnerDeceased, and it's conditional, so "Owner has not been declared deceased." So basically it checks first that the owner is deceased. So if it's not, it's going to throw that message. That's the first thing. It also require, as part of the condition, an address,…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.