From the course: Blockchain Programming in iOS Using Swift

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Implementing smart contracts

Implementing smart contracts

- [Narrator] Hello and welcome back. Now that you understand what exactly are smart contracts, let's go ahead and implement a very simple smart contract that is going to allow us to apply transaction fees based on the type of transaction that we're doing. Currently, our transaction class doesn't even have anything called fees or transaction type, we're going to add that later. Let's go, first of all, and create an enum which is going to allow us to find out what kind of a transaction we are doing. So transaction type, we can have different kind of transaction, we'll just focus on domestic transaction, as well as the international transaction. Okay? Now let's go ahead and then create a variable over here to hold these transaction types, so transaction type is transaction type. And also, I'm gonna add one more variable which will be representing the fees associated with the transactions. I'm gonna go ahead an update the initializer to add one more field so that it can take transaction…

Contents