SlideShare una empresa de Scribd logo
1 de 35
Descargar para leer sin conexión
Eno Bassey
Presentation By:
Ethereum: Solidity - Basics and Fundamentals
@ennytwit
- Senior Consultant @ Andela
- Php, C#, Python, Ruby & Solidity
- Drama Director
- Anime Lover
- BasketBaller
- Football Analyst
Contents
What can you do today with Ethereum
Understanding Dapp
Web Applications vs Dapp
Ethereum Nodes
Ether and its denominations
Using MetaMask
Smart Contract - Writing Code with Remix
Smart Contract - Same Contract with Editor
More about Ethereum
What you can do today with Ethereum and Dapps?
- The Ethereum Blockchain can be used as a public blockchain and
- A protocol for the creation of many blockchains (Private blockchain)
What can be done in both?
- Send and Receive Ether
- Write Smart Contracts
- Create provable fair applications
- Launch your own token based on ether
- The promise of Decentralized Databases
Understanding Dapp
What is a Dapp?
It is a Decentralized application
- It is a peer to peer solution 

- Data is shared 

- Code is shared
Web Applications vs Dapp
Ethereum Nodes
Kenya
Ethereum Virtual Machines: Mining Nodes:
Think of EVM as the execution runtime for
Ethereum network. EVM’s main function is to
provide a runtime where all smart contracts
code are executed.

EVM are the execution component in
Ethereum. The purpose of EVM is to execute
the code in smart contract line by line.
Mining Nodes refers the nodes that belong to Miners.
These nodes are part of the same network where EVM is
hosted. At some point of time, the miners would create a
new Block, collect all transaction from transaction pool and
adds them to the newly created block. Finally, this Block is
added to the chain
Working with the Ethereum Network
Types of Transactions in Ethereum
1. Transfer of Ether from one account to another
2. Deployment of Smart contract .
3. Using or invoking a function within a contract
Each of the above requires an amount of Ether to execute
Components of a Transaction in Ethereum
Component Description
From It denotes the account originating the transaction
To It denotes the account receiving the ethers or benefits of the transaction
Value The value of the ether being transferred or executed
BlockHash The Hash of the block this transaction belongs to
Block Number Block the transaction belongs to
GasPrice The price per gas the sender is willing to pay in Wei
Gas Amount of gas supplied by the sender which is executing this transaction
Hash Hash of the transaction
Nonce How many times the sender has sent a transactions prior to this one
TransactionIndex Serial Number of Transaction in block
V
This is the digital signature and signing of the transaction in cryptographic pieces of dataR
S
Components of a Block in Ethereum
Component Description
Difficulty It determines the complexity of the puzzle/challenge given to the miners for this
block
GasLimit It determines the maximum gas allowed.
GasUsed The actual gas used for this block for executing all transactions in it.
Miner The account identifier of miner also known as coinbase or Etherbase
Number The sequential number of this block on the chain
ParentHash The parents blocks hash
ReceiptsRoot, StateRoot and
transactionRoot
Refers to Merkel trees discussed during mining process.
Hash Hash of the transaction
Nonce How many times the sender has sent a transactions prior to this one
Transactions The array of transactions that are part of this block.
TotalDifficulty The total difficulty of the chain until this block
The Ether
Ether is the currency of Ethereum.




Every activity on Ethereum that modifies its state costs Ether as fee and
miners who are successful in generating and writing a block in chain are also
rewards Ether
Denominations of Ether
https://etherconverter.online/
https://github.com/ethereum/web3.js/blob/0.15.0/lib/utils/utils.js#L40
Conversion Tool
Fig 1.0 Units of Ether
Gas Costs
Ether is the currency of Ethereum.




Every activity on Ethereum that modifies its state costs Ether as fee and
miners who are successful in generating and writing a block in chain are also
rewards Ether
Writing Solidity
Writing Smart Contracts with Solidity
Versioning : Every smart contract in Solidity is tied to a version and must run
on the version to work effectively.
pragma solidity ^ 0.4.0;
contract Conditional {
uint refVal = 10;
uint limit = 20;
function isGreaterEqualUnderLimit(uint testVal) view public returns(bool) {
if (testVal >= refVal
&& testVal < limit) {
return true;
}
}
}
How smart contracts are deployed
ABI (Application Binary Interface): This is an interface consisting of all external
and public function declarations along with their parameters and return types.
All smart contracts are compiled into two components:
ByteCode : represents the contract and is deployed in Ethereum ecosystem.
An easy simple tool to compile code is REMIX. https://remix.ethereum.org
How smart contracts are deployed
How smart contracts are deployed
Basic Solidity Types
Basic Types
Name Description Examples
string Sequence of characters [Hi there] [I am here!!!]
bool Boolean Value true or false
int Integer, positive or negative. Has no decimal 0 -3000 59158
uint
Unsigned’ integer, positive integer. Has no
decimal
0 3000 80158
fixed/ufixed
Fixed’ point number. Number with a decimal
after it
24.56. -54.678 3.14
Address Has methods tied to it for sending money 0x18bae199c8dbae199c8d
Function Types
Common Function Types
public Anyone can call this function
private Only this contract can call this function
view
This function returns data and does not modify the
contracts data
constant
This function returns data and does not modify the
contract’s data
pure
This function will not modify or even read the contracts
data
payable
When this function is called some amount of ether will be
‘charged’
Processing Contract Functions
Process Tips
‘Calling’ a Function Sending a Transaction to a Function
Cannot modify contract’s data Can modify a contract’s data
Can return data Returns the transaction hast
Runs instantly Takes Time to execute
Free to do or use Cost Money/Gas
Tools to use for Solidity Development
Node
Truffle
Ganache
MetaMask (extension for chrome)
IDEs e.g Atom, VSCode etc
Syntax Highlighting for your IDE
Remix
Remix
What is Remix?
Remix is an online solidity IDE that is used for writing and testing smart
contracts
http://remix.ethereum.org
https://remix.readthedocs.io/en/latest/
Location:
Documentation:
Workshop 1
Solidity 1: Simple Message Contract
Solidity with Javascript
using IDEs
Syntax highlighting for IDEs
Atom - https://atom.io/packages/language-ethereum
Open the package installation manager in atom and search for 'language-ethereum'. 

After installing the package, you might have to manually change the highlighter in the .sol file. Look for the
selector at the bottom right of your editor window.

Sublime - https://packagecontrol.io/packages/Ethereum

VSCode - https://github.com/juanfranblanco/vscode-solidity

Webstorm - https://plugins.jetbrains.com/plugin/9475-intellij-solidity

VIM - https://github.com/tomlion/vim-solidity
Folder Structure
Our Local Deployment
Deploy to the Network
Deploy to the Network
S
Workshop 2
Solidity 2: Simple Voting Contract
Using Truffle
Thank You
Questions

Más contenido relacionado

La actualidad más candente

Hyperledger Fabric in a Nutshell
Hyperledger Fabric in a NutshellHyperledger Fabric in a Nutshell
Hyperledger Fabric in a NutshellDaniel Chan
 
Learning Solidity
Learning SolidityLearning Solidity
Learning SolidityArnold Pham
 
Ethereum in a nutshell
Ethereum in a nutshellEthereum in a nutshell
Ethereum in a nutshellDaniel Chan
 
Blockchain HyperLedger Fabric Internals - Clavent
Blockchain HyperLedger Fabric Internals - ClaventBlockchain HyperLedger Fabric Internals - Clavent
Blockchain HyperLedger Fabric Internals - ClaventAraf Karsh Hamid
 
Smart Contract & Ethereum
Smart Contract & EthereumSmart Contract & Ethereum
Smart Contract & EthereumAkshay Singh
 
Crypto Wallet Types Explained
Crypto Wallet Types ExplainedCrypto Wallet Types Explained
Crypto Wallet Types Explained101 Blockchains
 
ERC20 Step-by-Step - Creating Your First Ethereum Token
ERC20 Step-by-Step - Creating Your First Ethereum TokenERC20 Step-by-Step - Creating Your First Ethereum Token
ERC20 Step-by-Step - Creating Your First Ethereum TokenCodeOps Technologies LLP
 
Non-fungible tokens (nfts)
Non-fungible tokens (nfts)Non-fungible tokens (nfts)
Non-fungible tokens (nfts)Gene Leybzon
 
Smart contracts using web3.js
Smart contracts using web3.jsSmart contracts using web3.js
Smart contracts using web3.jsFelix Crisan
 
Ethereum (Blockchain Network)
Ethereum (Blockchain Network)Ethereum (Blockchain Network)
Ethereum (Blockchain Network)Qais Ammari
 
Ethereum Blockchain with Smart contract and ERC20
Ethereum Blockchain with Smart contract and ERC20Ethereum Blockchain with Smart contract and ERC20
Ethereum Blockchain with Smart contract and ERC20Truong Nguyen
 
What is A Smart Contract? | Smart Contracts Tutorial | Smart Contracts in Blo...
What is A Smart Contract? | Smart Contracts Tutorial | Smart Contracts in Blo...What is A Smart Contract? | Smart Contracts Tutorial | Smart Contracts in Blo...
What is A Smart Contract? | Smart Contracts Tutorial | Smart Contracts in Blo...Simplilearn
 

La actualidad más candente (20)

Hyperledger Fabric in a Nutshell
Hyperledger Fabric in a NutshellHyperledger Fabric in a Nutshell
Hyperledger Fabric in a Nutshell
 
Learning Solidity
Learning SolidityLearning Solidity
Learning Solidity
 
Ethereum in a nutshell
Ethereum in a nutshellEthereum in a nutshell
Ethereum in a nutshell
 
Blockchain HyperLedger Fabric Internals - Clavent
Blockchain HyperLedger Fabric Internals - ClaventBlockchain HyperLedger Fabric Internals - Clavent
Blockchain HyperLedger Fabric Internals - Clavent
 
Smart Contract & Ethereum
Smart Contract & EthereumSmart Contract & Ethereum
Smart Contract & Ethereum
 
Crypto Wallet Types Explained
Crypto Wallet Types ExplainedCrypto Wallet Types Explained
Crypto Wallet Types Explained
 
Ethereum
EthereumEthereum
Ethereum
 
Tokenization v2
Tokenization v2Tokenization v2
Tokenization v2
 
Smart contracts
Smart contractsSmart contracts
Smart contracts
 
ERC20 Step-by-Step - Creating Your First Ethereum Token
ERC20 Step-by-Step - Creating Your First Ethereum TokenERC20 Step-by-Step - Creating Your First Ethereum Token
ERC20 Step-by-Step - Creating Your First Ethereum Token
 
Non-fungible tokens (nfts)
Non-fungible tokens (nfts)Non-fungible tokens (nfts)
Non-fungible tokens (nfts)
 
Smart contracts using web3.js
Smart contracts using web3.jsSmart contracts using web3.js
Smart contracts using web3.js
 
Hyperledger Fabric
Hyperledger FabricHyperledger Fabric
Hyperledger Fabric
 
Ethereum (Blockchain Network)
Ethereum (Blockchain Network)Ethereum (Blockchain Network)
Ethereum (Blockchain Network)
 
Smart contract
Smart contractSmart contract
Smart contract
 
Ethereum Blockchain with Smart contract and ERC20
Ethereum Blockchain with Smart contract and ERC20Ethereum Blockchain with Smart contract and ERC20
Ethereum Blockchain with Smart contract and ERC20
 
Hyperledger
HyperledgerHyperledger
Hyperledger
 
What the Duck is DeFi
What the Duck is DeFiWhat the Duck is DeFi
What the Duck is DeFi
 
What is A Smart Contract? | Smart Contracts Tutorial | Smart Contracts in Blo...
What is A Smart Contract? | Smart Contracts Tutorial | Smart Contracts in Blo...What is A Smart Contract? | Smart Contracts Tutorial | Smart Contracts in Blo...
What is A Smart Contract? | Smart Contracts Tutorial | Smart Contracts in Blo...
 
All About Ethereum
All About EthereumAll About Ethereum
All About Ethereum
 

Similar a Ethereum Solidity Fundamentals

Ethereum Tutorial - Ethereum Explained | What is Ethereum? | Ethereum Explain...
Ethereum Tutorial - Ethereum Explained | What is Ethereum? | Ethereum Explain...Ethereum Tutorial - Ethereum Explained | What is Ethereum? | Ethereum Explain...
Ethereum Tutorial - Ethereum Explained | What is Ethereum? | Ethereum Explain...Simplilearn
 
Ethereum Block Chain
Ethereum Block ChainEthereum Block Chain
Ethereum Block ChainSanatPandoh
 
Ethereum
EthereumEthereum
EthereumV C
 
Block chain - Smart contacts.pptx
Block chain - Smart contacts.pptxBlock chain - Smart contacts.pptx
Block chain - Smart contacts.pptxshraddhaphirke1
 
Blockchain Development
Blockchain DevelopmentBlockchain Development
Blockchain Developmentpreetikumara
 
How to not Destroy Millions in Smart Contracts
How to not Destroy Millions in Smart ContractsHow to not Destroy Millions in Smart Contracts
How to not Destroy Millions in Smart ContractsLeonid Beder
 
Encode x NEAR: Technical Overview of NEAR 1
Encode x NEAR: Technical Overview of NEAR 1Encode x NEAR: Technical Overview of NEAR 1
Encode x NEAR: Technical Overview of NEAR 1KlaraOrban
 
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereumDappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereumTomoaki Sato
 
Ethereum Block Chain
Ethereum Block ChainEthereum Block Chain
Ethereum Block ChainSanatPandoh
 
The JavaScript toolset for development on Ethereum
The JavaScript toolset for development on EthereumThe JavaScript toolset for development on Ethereum
The JavaScript toolset for development on EthereumGreeceJS
 
Javascript toolset for Ethereum Smart Contract development
Javascript toolset for Ethereum Smart Contract developmentJavascript toolset for Ethereum Smart Contract development
Javascript toolset for Ethereum Smart Contract developmentBugSense
 
Developing Blockchain Applications
Developing Blockchain Applications Developing Blockchain Applications
Developing Blockchain Applications malikmayank
 
Blockchain Chapter #4.pdf
Blockchain Chapter #4.pdfBlockchain Chapter #4.pdf
Blockchain Chapter #4.pdfssuser79c46d1
 
Building Apps with Ethereum Smart Contract
Building Apps with Ethereum Smart ContractBuilding Apps with Ethereum Smart Contract
Building Apps with Ethereum Smart ContractVaideeswaran Sethuraman
 
Tucson Blockchain Developers Meetup - Sept 27 - Signed messages in ethereum p...
Tucson Blockchain Developers Meetup - Sept 27 - Signed messages in ethereum p...Tucson Blockchain Developers Meetup - Sept 27 - Signed messages in ethereum p...
Tucson Blockchain Developers Meetup - Sept 27 - Signed messages in ethereum p...Destry Saul
 
Ethereum Explained | Understanding Ethereum Blockchain Protocols | Ethereum C...
Ethereum Explained | Understanding Ethereum Blockchain Protocols | Ethereum C...Ethereum Explained | Understanding Ethereum Blockchain Protocols | Ethereum C...
Ethereum Explained | Understanding Ethereum Blockchain Protocols | Ethereum C...Edureka!
 

Similar a Ethereum Solidity Fundamentals (20)

Ethereum Tutorial - Ethereum Explained | What is Ethereum? | Ethereum Explain...
Ethereum Tutorial - Ethereum Explained | What is Ethereum? | Ethereum Explain...Ethereum Tutorial - Ethereum Explained | What is Ethereum? | Ethereum Explain...
Ethereum Tutorial - Ethereum Explained | What is Ethereum? | Ethereum Explain...
 
Ethereum
EthereumEthereum
Ethereum
 
Ethereum Block Chain
Ethereum Block ChainEthereum Block Chain
Ethereum Block Chain
 
Ethereum
EthereumEthereum
Ethereum
 
Block chain - Smart contacts.pptx
Block chain - Smart contacts.pptxBlock chain - Smart contacts.pptx
Block chain - Smart contacts.pptx
 
Blockchain Development
Blockchain DevelopmentBlockchain Development
Blockchain Development
 
How to not Destroy Millions in Smart Contracts
How to not Destroy Millions in Smart ContractsHow to not Destroy Millions in Smart Contracts
How to not Destroy Millions in Smart Contracts
 
Encode x NEAR: Technical Overview of NEAR 1
Encode x NEAR: Technical Overview of NEAR 1Encode x NEAR: Technical Overview of NEAR 1
Encode x NEAR: Technical Overview of NEAR 1
 
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereumDappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereum
 
How to design, code, deploy and execute a smart contract
How to design, code, deploy and execute a smart contractHow to design, code, deploy and execute a smart contract
How to design, code, deploy and execute a smart contract
 
Ethereum vs fabric vs corda
Ethereum vs fabric vs cordaEthereum vs fabric vs corda
Ethereum vs fabric vs corda
 
Ethereum Block Chain
Ethereum Block ChainEthereum Block Chain
Ethereum Block Chain
 
The JavaScript toolset for development on Ethereum
The JavaScript toolset for development on EthereumThe JavaScript toolset for development on Ethereum
The JavaScript toolset for development on Ethereum
 
Javascript toolset for Ethereum Smart Contract development
Javascript toolset for Ethereum Smart Contract developmentJavascript toolset for Ethereum Smart Contract development
Javascript toolset for Ethereum Smart Contract development
 
Developing Blockchain Applications
Developing Blockchain Applications Developing Blockchain Applications
Developing Blockchain Applications
 
Ethereum-Cryptocurrency (All about Ethereum)
Ethereum-Cryptocurrency (All about Ethereum) Ethereum-Cryptocurrency (All about Ethereum)
Ethereum-Cryptocurrency (All about Ethereum)
 
Blockchain Chapter #4.pdf
Blockchain Chapter #4.pdfBlockchain Chapter #4.pdf
Blockchain Chapter #4.pdf
 
Building Apps with Ethereum Smart Contract
Building Apps with Ethereum Smart ContractBuilding Apps with Ethereum Smart Contract
Building Apps with Ethereum Smart Contract
 
Tucson Blockchain Developers Meetup - Sept 27 - Signed messages in ethereum p...
Tucson Blockchain Developers Meetup - Sept 27 - Signed messages in ethereum p...Tucson Blockchain Developers Meetup - Sept 27 - Signed messages in ethereum p...
Tucson Blockchain Developers Meetup - Sept 27 - Signed messages in ethereum p...
 
Ethereum Explained | Understanding Ethereum Blockchain Protocols | Ethereum C...
Ethereum Explained | Understanding Ethereum Blockchain Protocols | Ethereum C...Ethereum Explained | Understanding Ethereum Blockchain Protocols | Ethereum C...
Ethereum Explained | Understanding Ethereum Blockchain Protocols | Ethereum C...
 

Último

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 

Último (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 

Ethereum Solidity Fundamentals

  • 1. Eno Bassey Presentation By: Ethereum: Solidity - Basics and Fundamentals
  • 2. @ennytwit - Senior Consultant @ Andela - Php, C#, Python, Ruby & Solidity - Drama Director - Anime Lover - BasketBaller - Football Analyst
  • 3. Contents What can you do today with Ethereum Understanding Dapp Web Applications vs Dapp Ethereum Nodes Ether and its denominations Using MetaMask Smart Contract - Writing Code with Remix Smart Contract - Same Contract with Editor
  • 5. What you can do today with Ethereum and Dapps? - The Ethereum Blockchain can be used as a public blockchain and - A protocol for the creation of many blockchains (Private blockchain) What can be done in both? - Send and Receive Ether - Write Smart Contracts - Create provable fair applications - Launch your own token based on ether - The promise of Decentralized Databases
  • 6. Understanding Dapp What is a Dapp? It is a Decentralized application - It is a peer to peer solution 
 - Data is shared 
 - Code is shared
  • 8. Ethereum Nodes Kenya Ethereum Virtual Machines: Mining Nodes: Think of EVM as the execution runtime for Ethereum network. EVM’s main function is to provide a runtime where all smart contracts code are executed.
 EVM are the execution component in Ethereum. The purpose of EVM is to execute the code in smart contract line by line. Mining Nodes refers the nodes that belong to Miners. These nodes are part of the same network where EVM is hosted. At some point of time, the miners would create a new Block, collect all transaction from transaction pool and adds them to the newly created block. Finally, this Block is added to the chain
  • 9. Working with the Ethereum Network
  • 10. Types of Transactions in Ethereum 1. Transfer of Ether from one account to another 2. Deployment of Smart contract . 3. Using or invoking a function within a contract Each of the above requires an amount of Ether to execute
  • 11. Components of a Transaction in Ethereum Component Description From It denotes the account originating the transaction To It denotes the account receiving the ethers or benefits of the transaction Value The value of the ether being transferred or executed BlockHash The Hash of the block this transaction belongs to Block Number Block the transaction belongs to GasPrice The price per gas the sender is willing to pay in Wei Gas Amount of gas supplied by the sender which is executing this transaction Hash Hash of the transaction Nonce How many times the sender has sent a transactions prior to this one TransactionIndex Serial Number of Transaction in block V This is the digital signature and signing of the transaction in cryptographic pieces of dataR S
  • 12. Components of a Block in Ethereum Component Description Difficulty It determines the complexity of the puzzle/challenge given to the miners for this block GasLimit It determines the maximum gas allowed. GasUsed The actual gas used for this block for executing all transactions in it. Miner The account identifier of miner also known as coinbase or Etherbase Number The sequential number of this block on the chain ParentHash The parents blocks hash ReceiptsRoot, StateRoot and transactionRoot Refers to Merkel trees discussed during mining process. Hash Hash of the transaction Nonce How many times the sender has sent a transactions prior to this one Transactions The array of transactions that are part of this block. TotalDifficulty The total difficulty of the chain until this block
  • 13. The Ether Ether is the currency of Ethereum. 
 
 Every activity on Ethereum that modifies its state costs Ether as fee and miners who are successful in generating and writing a block in chain are also rewards Ether
  • 15. Gas Costs Ether is the currency of Ethereum. 
 
 Every activity on Ethereum that modifies its state costs Ether as fee and miners who are successful in generating and writing a block in chain are also rewards Ether
  • 17. Writing Smart Contracts with Solidity Versioning : Every smart contract in Solidity is tied to a version and must run on the version to work effectively. pragma solidity ^ 0.4.0; contract Conditional { uint refVal = 10; uint limit = 20; function isGreaterEqualUnderLimit(uint testVal) view public returns(bool) { if (testVal >= refVal && testVal < limit) { return true; } } }
  • 18. How smart contracts are deployed ABI (Application Binary Interface): This is an interface consisting of all external and public function declarations along with their parameters and return types. All smart contracts are compiled into two components: ByteCode : represents the contract and is deployed in Ethereum ecosystem. An easy simple tool to compile code is REMIX. https://remix.ethereum.org
  • 19. How smart contracts are deployed
  • 20. How smart contracts are deployed
  • 21. Basic Solidity Types Basic Types Name Description Examples string Sequence of characters [Hi there] [I am here!!!] bool Boolean Value true or false int Integer, positive or negative. Has no decimal 0 -3000 59158 uint Unsigned’ integer, positive integer. Has no decimal 0 3000 80158 fixed/ufixed Fixed’ point number. Number with a decimal after it 24.56. -54.678 3.14 Address Has methods tied to it for sending money 0x18bae199c8dbae199c8d
  • 22. Function Types Common Function Types public Anyone can call this function private Only this contract can call this function view This function returns data and does not modify the contracts data constant This function returns data and does not modify the contract’s data pure This function will not modify or even read the contracts data payable When this function is called some amount of ether will be ‘charged’
  • 23. Processing Contract Functions Process Tips ‘Calling’ a Function Sending a Transaction to a Function Cannot modify contract’s data Can modify a contract’s data Can return data Returns the transaction hast Runs instantly Takes Time to execute Free to do or use Cost Money/Gas
  • 24. Tools to use for Solidity Development Node Truffle Ganache MetaMask (extension for chrome) IDEs e.g Atom, VSCode etc Syntax Highlighting for your IDE Remix
  • 25. Remix What is Remix? Remix is an online solidity IDE that is used for writing and testing smart contracts http://remix.ethereum.org https://remix.readthedocs.io/en/latest/ Location: Documentation:
  • 26. Workshop 1 Solidity 1: Simple Message Contract
  • 28. Syntax highlighting for IDEs Atom - https://atom.io/packages/language-ethereum Open the package installation manager in atom and search for 'language-ethereum'. 
 After installing the package, you might have to manually change the highlighter in the .sol file. Look for the selector at the bottom right of your editor window.
 Sublime - https://packagecontrol.io/packages/Ethereum
 VSCode - https://github.com/juanfranblanco/vscode-solidity
 Webstorm - https://plugins.jetbrains.com/plugin/9475-intellij-solidity
 VIM - https://github.com/tomlion/vim-solidity
  • 31. Deploy to the Network
  • 32. Deploy to the Network
  • 33. S Workshop 2 Solidity 2: Simple Voting Contract Using Truffle