SlideShare a Scribd company logo
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

More Related Content

What's hot

Write smart contract with solidity on Ethereum
Write smart contract with solidity on EthereumWrite smart contract with solidity on Ethereum
Write smart contract with solidity on Ethereum
Murughan Palaniachari
 
Solidity
SoliditySolidity
Solidity
gavofyork
 
Ethereum in a nutshell
Ethereum in a nutshellEthereum in a nutshell
Ethereum in a nutshell
Daniel Chan
 
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
 
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
 
Write Smart Contract with Solidity on Ethereum
Write Smart Contract with Solidity on EthereumWrite Smart Contract with Solidity on Ethereum
Write Smart Contract with Solidity on Ethereum
劉 維仁
 
Smart contracts
Smart contractsSmart contracts
Smart contracts
Philippe Camacho, Ph.D.
 
Programming smart contracts in solidity
Programming smart contracts in solidityProgramming smart contracts in solidity
Programming smart contracts in solidity
Emanuel Mota
 
Introduction to Solidity and Smart Contract Development (9).pptx
Introduction to Solidity and Smart Contract Development (9).pptxIntroduction to Solidity and Smart Contract Development (9).pptx
Introduction to Solidity and Smart Contract Development (9).pptx
Gene Leybzon
 
Ethereum
EthereumEthereum
Ethereum
Brian Yap
 
Blockchain Presentation
Blockchain PresentationBlockchain Presentation
Blockchain Presentation
Zied GUESMI
 
How To Build A Career In Blockchain
How To Build A Career In BlockchainHow To Build A Career In Blockchain
How To Build A Career In Blockchain
101 Blockchains
 
Bitcoin, Ethereum, Smart Contract & Blockchain
Bitcoin, Ethereum, Smart Contract & BlockchainBitcoin, Ethereum, Smart Contract & Blockchain
Bitcoin, Ethereum, Smart Contract & Blockchain
Jitendra Chittoda
 
Smart Contract & Ethereum
Smart Contract & EthereumSmart Contract & Ethereum
Smart Contract & Ethereum
Akshay Singh
 
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
Truong Nguyen
 
Creating Smart Contract
Creating Smart ContractCreating Smart Contract
Creating Smart Contract
Deepak Aryal
 
How do bitcoin transactions work?
How do bitcoin transactions work?How do bitcoin transactions work?
How do bitcoin transactions work?
Pavel Kravchenko, PhD
 
What is TLS/SSL?
What is TLS/SSL? What is TLS/SSL?
What is TLS/SSL?
Shehzad Imran
 
All About Ethereum
All About EthereumAll About Ethereum
All About Ethereum
Oodles Technologies Pvt. Ltd.
 
Types of Blockchains
Types of BlockchainsTypes of Blockchains
Types of Blockchains
Vikram Khanna
 

What's hot (20)

Write smart contract with solidity on Ethereum
Write smart contract with solidity on EthereumWrite smart contract with solidity on Ethereum
Write smart contract with solidity on Ethereum
 
Solidity
SoliditySolidity
Solidity
 
Ethereum in a nutshell
Ethereum in a nutshellEthereum in a nutshell
Ethereum in a nutshell
 
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...
 
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...
 
Write Smart Contract with Solidity on Ethereum
Write Smart Contract with Solidity on EthereumWrite Smart Contract with Solidity on Ethereum
Write Smart Contract with Solidity on Ethereum
 
Smart contracts
Smart contractsSmart contracts
Smart contracts
 
Programming smart contracts in solidity
Programming smart contracts in solidityProgramming smart contracts in solidity
Programming smart contracts in solidity
 
Introduction to Solidity and Smart Contract Development (9).pptx
Introduction to Solidity and Smart Contract Development (9).pptxIntroduction to Solidity and Smart Contract Development (9).pptx
Introduction to Solidity and Smart Contract Development (9).pptx
 
Ethereum
EthereumEthereum
Ethereum
 
Blockchain Presentation
Blockchain PresentationBlockchain Presentation
Blockchain Presentation
 
How To Build A Career In Blockchain
How To Build A Career In BlockchainHow To Build A Career In Blockchain
How To Build A Career In Blockchain
 
Bitcoin, Ethereum, Smart Contract & Blockchain
Bitcoin, Ethereum, Smart Contract & BlockchainBitcoin, Ethereum, Smart Contract & Blockchain
Bitcoin, Ethereum, Smart Contract & Blockchain
 
Smart Contract & Ethereum
Smart Contract & EthereumSmart Contract & Ethereum
Smart Contract & Ethereum
 
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
 
Creating Smart Contract
Creating Smart ContractCreating Smart Contract
Creating Smart Contract
 
How do bitcoin transactions work?
How do bitcoin transactions work?How do bitcoin transactions work?
How do bitcoin transactions work?
 
What is TLS/SSL?
What is TLS/SSL? What is TLS/SSL?
What is TLS/SSL?
 
All About Ethereum
All About EthereumAll About Ethereum
All About Ethereum
 
Types of Blockchains
Types of BlockchainsTypes of Blockchains
Types of Blockchains
 

Similar to Ethereum Solidity Fundamentals

Ethereum Block Chain
Ethereum Block ChainEthereum Block Chain
Ethereum Block Chain
SanatPandoh
 
Ethereum
EthereumEthereum
Ethereum
V C
 
Block chain - Smart contacts.pptx
Block chain - Smart contacts.pptxBlock chain - Smart contacts.pptx
Block chain - Smart contacts.pptx
shraddhaphirke1
 
Blockchain Development
Blockchain DevelopmentBlockchain Development
Blockchain Development
preetikumara
 
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
Tomoaki Sato
 
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
Joseph Holbrook, Chief Learning Officer (CLO)
 
Ethereum vs fabric vs corda
Ethereum vs fabric vs cordaEthereum vs fabric vs corda
Ethereum vs fabric vs corda
Jean-Christophe Busnel
 
Ethereum Block Chain
Ethereum Block ChainEthereum Block Chain
Ethereum Block Chain
SanatPandoh
 
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
BugSense
 
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
GreeceJS
 
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.pdf
ssuser79c46d1
 
Building Apps with Ethereum Smart Contract
Building Apps with Ethereum Smart ContractBuilding Apps with Ethereum Smart Contract
Building Apps with Ethereum Smart Contract
Vaideeswaran 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!
 
Blockchain, Ethereum and Business Applications
Blockchain, Ethereum and Business ApplicationsBlockchain, Ethereum and Business Applications
Blockchain, Ethereum and Business Applications
Matthias Zimmermann
 
Blockchain
BlockchainBlockchain
Blockchain
Rishabh Sharma
 
Hello world contract
Hello world contractHello world contract
Hello world contract
Gene Leybzon
 
Ethereum bxl
Ethereum bxlEthereum bxl
Ethereum bxl
Benjamin MATEO
 
Chapter 3.pptx
Chapter 3.pptxChapter 3.pptx
Chapter 3.pptx
AvinashChoure2
 

Similar to Ethereum Solidity Fundamentals (20)

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
 
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
 
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
 
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
 
Developing Blockchain Applications
Developing Blockchain Applications Developing Blockchain Applications
Developing Blockchain Applications
 
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...
 
Blockchain, Ethereum and Business Applications
Blockchain, Ethereum and Business ApplicationsBlockchain, Ethereum and Business Applications
Blockchain, Ethereum and Business Applications
 
Blockchain
BlockchainBlockchain
Blockchain
 
Hello world contract
Hello world contractHello world contract
Hello world contract
 
Ethereum bxl
Ethereum bxlEthereum bxl
Ethereum bxl
 
Chapter 3.pptx
Chapter 3.pptxChapter 3.pptx
Chapter 3.pptx
 

Recently uploaded

Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 

Recently uploaded (20)

Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 

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