A tutorial on Smart Contracts for IoT systems

Dep. of Electrical and Electronics Engineering

University of West Attica

Smart contracts are a transformative technology, enabling secure, automated, and transparent transactions without intermediaries. Despite their potential, their application in Internet of Things (IoT) use cases remains underexplored, leaving a gap in understanding how these contracts can enhance IoT ecosystems through secure device communication, data validation, and automated processes.

This site provides a comprehensive tutorial tailored for embedded system and IoT developers, offering step-by-step guidance on learning about smart contracts and integrating them into IoT applications to unlock their full potential. It can be used as a graduate or undergraduate course on the domain of computer science and computer engineering. It also presents a use case example in which a smart contract is used to control a raspeberry pi that could be used for automating the payment of car renting.

Section 1: Introducion

Thumbnail for Slide 1
Lecture 1: Introduction to Blockchain

Introduction to Blockchain

Thumbnail for Slide 1
Lecture 2: Yout first transaction

Yout first blockchain transaction

Thumbnail for Slide 1
Lecture 3: Intro to remix

Introduction to remix

Thumbnail for Slide 1
Lecture 4: Your first smart contract

A simple smart contract

Thumbnail for Slide 1
Lecture 5: Variables

Introduction to variables

Section 2: Smart Contracts for IoTs

Thumbnail for Slide 1
Lecture 1: Smart Car Renting Service

Introduction to a use case for car renting using smart contracts

Thumbnail for Slide 1
Lecture 2: Data Structures

Introduction to data structures

Thumbnail for Slide 1
Lecture 3: Conditional Logic and Loops

Introduction to Conditional Logic and Loops

Thumbnail for Slide 1
Lecture 4: Enum

Introduction to enumaration

Thumbnail for Slide 1
Lecture 5: MSG Sender

Introduction to MSG sender

Thumbnail for Slide 1
Lecture 6: Access Control

Introduction to Access Control

Thumbnail for Slide 1
Lecture 7: Payable functions

Introduction to Payable functions

Thumbnail for Slide 1
Lecture 8: Events

Introduction to events

Thumbnail for Slide 1
Lecture 9: Inheritance

Introduction to Inheritance

Thumbnail for Slide 1
Lecture 10: Withdraw Ether - Time in blockchains

Introduction to time in blockchains

Thumbnail for Slide 1
Lecture 11: Tricks

Tricks and best practices

Thumbnail for Slide 1
Lecture 12: ICR Factory

Introduction to ICR Factory

Thumbnail for Slide 1
Lecture 13: Ready to use contracts

Integrated contracts

Thumbnail for Slide 1
Lecture 14: External Function Calls

Introduction to external function calls

Thumbnail for Slide 1
Lecture 15: Final changes and integration

Final modifications for the use case on IoTs

Section 3: A use case for Smart Contracts on Raspberry pi

Thumbnail for Slide 1
Lecture 1: Intro to Web3

Introduction to web3

Thumbnail for Slide 1
Lecture 2: Python ICR Create account

Introduction to Python ICR account

Thumbnail for Slide 1
Lecture 3: Synchronize IoT

How to synchronize with IoT

Thumbnail for Slide 1
Lecture 4: Unlock Car

How to unlock the car.

Thumbnail for Slide 1
Lecture 5: Change Car status

How to change the car status.

Thumbnail for Slide 1
Lecture 6: Full example

Integration of the use case

Ioannis Christidis, Christoforos Kachris

Support by Ethereum Foundation.