0% found this document useful (0 votes)
3 views11 pages

Lecture 5

The document discusses the second-generation blockchain, Ethereum, focusing on the Ethereum Virtual Machine (EVM), the Solidity programming language, and smart contract examples. It highlights the significance of ERC-20 tokens as a technical standard for Ethereum-based tokens and provides exercises for creating a lottery decentralized app and an ERC-20 token. Useful links for further learning and resources are also included.

Uploaded by

Relisqu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views11 pages

Lecture 5

The document discusses the second-generation blockchain, Ethereum, focusing on the Ethereum Virtual Machine (EVM), the Solidity programming language, and smart contract examples. It highlights the significance of ERC-20 tokens as a technical standard for Ethereum-based tokens and provides exercises for creating a lottery decentralized app and an ERC-20 token. Useful links for further learning and resources are also included.

Uploaded by

Relisqu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Lecture 5: The 2nd-

generation
blockchain
(Ethereum) 2
Hamza Salem - Innopolis University
Topics
● EVM Explained
● Solidity
● Smart Contract Examples ..
● ICO initial coin offering
● ERC-20 Token.
Meme Review
Solidity
❏ Solidity is an object-oriented, high-level language for
implementing smart contracts.
❏ Smart contracts are programs which govern the behaviour of
accounts within the Ethereum state. Solidity is a curly-bracket
language designed to target the Ethereum Virtual Machine (EVM).
❏ It is influenced by C++, Python and JavaScript. Solidity is
statically typed, supports inheritance, libraries and complex
user-defined types among other features.
❏ With Solidity you can create contracts for uses such as voting,
crowdfunding, blind auctions, and multi-signature wallets.
Let Me Explain ..
❏ Accounts vs Smart Contract
❏ External Contract vs contracts Account
❏ Storage, Memory and the Stack (Memory in Solidity is a temporary place to store data whereas
Storage holds data between function calls)

❏ msg.sender and msg.value


❏ Precompiled Contracts

Let us try ..

https://docs.soliditylang.org/en/v0.8.21/
Coin Contract
❏ Simplest form of a cryptocurrency. The contract allows only its
creator to create new coins.
Example 1: Lottery Smart
Contract ● https://github.com/phillipdodd
/solidity-lottery/blob/master/c
ontracts/Lottery.sol
Example 2: ERC-20 Token Smart
Contract
- One of the most significant Ethereum tokens is known as ERC-20.
ERC-20 has emerged as the technical standard; it is used for all
smart contracts on the Ethereum blockchain for token
implementation and provides a list of rules that all Ethereum-based
tokens must follow.
- ERC-20 is similar, in some respects, to bitcoin, Litecoin, and any
other cryptocurrency; ERC-20 tokens are blockchain-based assets
that have value and can be sent and received. The primary
difference is that instead of running on their own blockchain, ERC-
20 tokens are issued on the Ethereum network.
- Check Notes of the slides.
Exercise 1: Lottery
Decentralized app
● Make UI for Example 1 lottery.
● Modify the contract to make any address started with 0xDXXXXXX or
0xFXXXXXX to win and if both participated to be random again.
Exercise 2: ERC-20
● Create Your own Token with 10,000,000 total supply.
○ Name: Innopolis Email ex: h.salem
○ Symbol: YOUR FIRST NAME
● Make UI for Execution Your Contract (Total Supply, Name,Symbol).
● Make simple UI For transferring tokens between users & show how
many users and how much their own from the tokens.
● Modify send function to send 50 Token to this address
0xD8C7978Be2A06F5752cB727fB3B7831B70bF394d every time any transfer happen.
● Deploy your Dapp on any web hosting platform and add links to the
main repo
Useful links
● https://www.toptal.com/ethereum/create-erc20-token-tutorial
● https://ethereum.stackexchange.com/questions/50310/how-to-pass-
the-value-in-bytes32-array
● https://github.com/phillipdodd/solidity-lottery/blob/master/contracts/
Lottery.sol
● https://docs.soliditylang.org/en/v0.8.21/introduction-to-smart-contra
cts.html#simple-smart-contract

● https://docs.soliditylang.org/en/v0.8.21/grammar.html

You might also like