About The Presenter

Class Plan

Course Description

  • Design, code, execute and deploy a smart contract
  • Foundational concepts of Solidity programming language will be covered.
  • Value types, data structures, global variables and basic functions.
  • Best practices for secure smart contract development, deployment and testing.
  • Design and develope e2e web3.0 applications using industry standard tools.

Learning outcome

  • Identify use of data types, data structures and global variables available in solidity.
  • Able to deploy and interact with smart contract.
  • Architect the decentralized application
  • Analyze a given use case and design a smart-contract based solution

Course Outline (Smart Contracts)

Introduction to Smart Contracts

Solidity

Developing a smart contract

Evaluation and best practices for smart contract.

Evaluation

Assessment Description Weightage
Participation In class participation in various activities 10%
Lab-1 Smart contract and data types 30%
Lab-2 Understanding global functions in solidity 30%
Lab-3 Use of modifiers and error handling 30%

Developing a smart contract

Analyze the problem

  • state variables and its visibility
  • functions and its visibility
  • access modifiers
  • Validation of input params in the function

Objectives

  • Apply concepts learned in last lessons to write a smart contract
  • Analyze a problem statement to implement and design a smart contract.
  • Program smart contract using solidity language and Remix IDE

Resources

Problem Statement (Ballot Contract)

  • A chairperson organizes this process
  • Initialize proposal number while contract creation
  • Chairperson registers all the voters
  • Voters including the chairperson vote on the proposal
  • Weight of two for the chairperson's vote
  • Winning proposal is determined and announced to the world

DEMO

  • Represent design using class diagram
  • Implementing a smart contract based on design

Precap

Week 4 Day 1

Events

  • Concept of event
  • Pushing event to a subscribed listener
  • Demonstrate the event using ballot example

Week 4 Day 2

Time-elements

  • Add stages and time duration of stages to ballot contract in previous session
  • Add required logic to modify the stages in the function

Week 4 Day 3

Auditing a smart contract

  • Importance of smart contract audit
  • Review of smart contract analysis tools and best practices