Doing Smart-Contracts with Ethereum
An open software platform based on blockchain technology that enables developers to build and deploy decentralized applications.
There are two types of accounts in Ethereum
- EOA: An account controlled by a private key that has the ability to send ether and message from it.
- Smart contract: An account that has its own code, and is controlled by code.
What are Smart-Contracts?
Exchange money, property, shares, or anything of value in a transparent, conflict-free way while avoiding the services of a middleman
What are the Advantages?
- Clear Communication
- Paper Free
- Savings (no intermediaries)
Smart Contracts and Blockchain Nodes
What's executed and when?!
Every node has to verify the results of a transaction which invokes a smart contract. The result is that at least every full node will execute the code.
When a node gets a transaction, it only does a few basic checks first, such as:
- 1) is the signature valid?
- 2) does the sending account have enough Ether to pay for the gas?
- 3) is the gas below the block gas limit?
Solidity is a contract-oriented programming language for writing smart contracts.
Development framework for Ethereum.
Local blockchain for development.
Browser plugin: Brings Ethereum to your browser
Action: Smart-Contracts Labs
- 1) Debugging a smart contract
- 2) Pet-shop Dapp
- 3) Robust smart contracts with Openzeppelin - Protocol standard ERC20 (bonus)
What is the difference between smart contracts and dApps?
- dApps (Decentralized apps) are basically blockchain enabled websites/platforms.
- Smart contracts act like a logic brick that empowers dApps to connect with Blockchain.
Lab 1: smart contract
Lab 2: our first dApp
Lab 3: bonus