SlideShare a Scribd company logo
1 of 13
Solidity 
What and Why
Problem 
Need people to write contracts. 
Correct contracts. 
Lots of people.
Solutions 
Tend to be Web devs 
Syntax similar to JavaScript 
...to minimise barriers to entry and leverage existing skillset
Solutions 
Express common concepts clearly 
First-class contracts as classes 
...for transparent integration and reuse 
Storage constructs 
...for ease of contract STORE usage 
Variadic returns 
...for ease of contract RETURN passing
Solutions 
Make things likely to be correct 
Unit tests 
...that are easier to use than not 
Formal proofing 
...that makes statements guaranteed always true
Solutions 
Documentation fundamental 
Inbuilt documentation system 
(See later talk)
Contracts as first-class citizens 
contract StoreNumber { 
void set(uint n) { ... } 
uint get() const { ... } 
... 
} 
contract Other { 
Other() { 
StoreNumber s = ...; 
s.set(69); 
... 
uint n = s.get(); 
} 
}
(Easy) Storage Facilities 
contract StoreNumber { 
function set(uint n) { m_n = n; } 
function get() const returns (uint) { 
return m_n; 
} 
uint m_n; 
}
(Easy) Storage Facilities 
struct Endpoint { 
uint32 ipv4; 
uint16 port; 
} 
contract Endpoints { 
function set(uint32 _ipv4, uint16 _port) { 
var end = new Endpoint({ipv4: _ipv4, port: 
_port}); 
m_ends[msg.caller] = end; 
} 
function kill() { delete m_ends[msg.caller]; } 
mapping { address => Endpoint } m_ends; 
}
Variadic Returns 
contract Endpoints { 
function set(uint32 _ipv4, uint16 _port) { 
var end = new Endpoint({ipv4: _ipv4, port: 
_port}); 
m_ends[msg.caller] = end; 
} 
function kill() { delete m_ends[msg.caller]; } 
function get(address _a) const 
returns (uint32, uint16) { 
return m_ends[_a]; 
} 
mapping { address => Endpoint } m_ends; 
}
Formal Proofing 
contract Cash { 
function give(address _a, uint32 _amount) { 
if (m_balances[msg.caller] >= _amount) { 
m_balances[msg.caller] -= _amount; 
m_balances[_a] += _amount; 
} 
} 
function balance(address _a) const returns (uint32) 
{ 
return m_balances[_a]; 
} 
mapping { address => uint64 } m_balances; 
construction: 
m_balances[msg.caller] = 1000000000; 
invariant: 
reduce(+, map(valueOf, m_balances)) == 1000000000; 
}
Inbuilt Docs (NatSpec) 
contract Cash { 
/// Transfers `_amount` cash from your account 
/// `msg.caller` to the account controlled by `_a`. 
function give(address _a, uint32 _amount) { 
if (m_balances[msg.caller] >= _amount) { 
m_balances[msg.caller] -= _amount; 
m_balances[_a] += _amount; 
} 
} 
/// Returns the amount of cash controlled by account 
/// `_a`. 
function balance(address _a) const returns (uint32) 
{ 
return m_balances[_a]; 
} 
mapping { address => uint64 } m_balances; 
construction: 
/// Creator of contract is endowed with balance of 
/// 1000000000. 
m_balances[msg.caller] = 1000000000; 
invariant: 
/// Total cash in system is always 1000000000. 
reduce(+, map(valueOf, m_balances)) == 1000000000; 
}
Solidity 
What and Why 
Over to Christian

More Related Content

What's hot

Introduction to Blockchain
Introduction to BlockchainIntroduction to Blockchain
Introduction to BlockchainMalak Abu Hammad
 
How does blockchain work
How does blockchain workHow does blockchain work
How does blockchain workShishir Aryal
 
Blockchain Fundamentals - Top Rated for Beginners
Blockchain Fundamentals - Top Rated for Beginners Blockchain Fundamentals - Top Rated for Beginners
Blockchain Fundamentals - Top Rated for Beginners 101 Blockchains
 
Blockchain, cryptography, and consensus
Blockchain, cryptography, and consensusBlockchain, cryptography, and consensus
Blockchain, cryptography, and consensusITU
 
Blockchain Presentation
Blockchain PresentationBlockchain Presentation
Blockchain PresentationZied GUESMI
 
Introduction to Blockchain
Introduction to BlockchainIntroduction to Blockchain
Introduction to BlockchainJordan Harris
 
Introduction to Blockchain and Smart Contracts
Introduction to Blockchain and Smart ContractsIntroduction to Blockchain and Smart Contracts
Introduction to Blockchain and Smart ContractsTechracers
 
Blockchain Technology
Blockchain TechnologyBlockchain Technology
Blockchain TechnologyRashi Singh
 
Ethereum in a nutshell
Ethereum in a nutshellEthereum in a nutshell
Ethereum in a nutshellDaniel Chan
 
Smart Contracts Programming Tutorial | Solidity Programming Language | Solidi...
Smart Contracts Programming Tutorial | Solidity Programming Language | Solidi...Smart Contracts Programming Tutorial | Solidity Programming Language | Solidi...
Smart Contracts Programming Tutorial | Solidity Programming Language | Solidi...Edureka!
 
Ethereum Solidity Fundamentals
Ethereum Solidity FundamentalsEthereum Solidity Fundamentals
Ethereum Solidity FundamentalsEno Bassey
 
Introduction to Ethereum
Introduction to EthereumIntroduction to Ethereum
Introduction to EthereumTerek Judi
 
An Introduction to Blockchain Technology
An Introduction to Blockchain Technology An Introduction to Blockchain Technology
An Introduction to Blockchain Technology Niuversity
 
Blockchain
BlockchainBlockchain
BlockchainSai Nath
 

What's hot (20)

Introduction to Blockchain
Introduction to BlockchainIntroduction to Blockchain
Introduction to Blockchain
 
How does blockchain work
How does blockchain workHow does blockchain work
How does blockchain work
 
Blockchain Fundamentals - Top Rated for Beginners
Blockchain Fundamentals - Top Rated for Beginners Blockchain Fundamentals - Top Rated for Beginners
Blockchain Fundamentals - Top Rated for Beginners
 
Blockchain, cryptography, and consensus
Blockchain, cryptography, and consensusBlockchain, cryptography, and consensus
Blockchain, cryptography, and consensus
 
Blockchain Presentation
Blockchain PresentationBlockchain Presentation
Blockchain Presentation
 
Blockchain
BlockchainBlockchain
Blockchain
 
Hyperledger Fabric
Hyperledger FabricHyperledger Fabric
Hyperledger Fabric
 
Introduction to Blockchain
Introduction to BlockchainIntroduction to Blockchain
Introduction to Blockchain
 
Introduction to Blockchain and Smart Contracts
Introduction to Blockchain and Smart ContractsIntroduction to Blockchain and Smart Contracts
Introduction to Blockchain and Smart Contracts
 
Blockchain and Banking
Blockchain and BankingBlockchain and Banking
Blockchain and Banking
 
All About Ethereum
All About EthereumAll About Ethereum
All About Ethereum
 
Blockchain Technology
Blockchain TechnologyBlockchain Technology
Blockchain Technology
 
Smart contract
Smart contractSmart contract
Smart contract
 
Ethereum in a nutshell
Ethereum in a nutshellEthereum in a nutshell
Ethereum in a nutshell
 
Smart Contracts Programming Tutorial | Solidity Programming Language | Solidi...
Smart Contracts Programming Tutorial | Solidity Programming Language | Solidi...Smart Contracts Programming Tutorial | Solidity Programming Language | Solidi...
Smart Contracts Programming Tutorial | Solidity Programming Language | Solidi...
 
Ethereum Solidity Fundamentals
Ethereum Solidity FundamentalsEthereum Solidity Fundamentals
Ethereum Solidity Fundamentals
 
Introduction to Ethereum
Introduction to EthereumIntroduction to Ethereum
Introduction to Ethereum
 
An Introduction to Blockchain Technology
An Introduction to Blockchain Technology An Introduction to Blockchain Technology
An Introduction to Blockchain Technology
 
Blockchain
BlockchainBlockchain
Blockchain
 
Cryptocurrency
CryptocurrencyCryptocurrency
Cryptocurrency
 

Viewers also liked

Ethereum Contracts - Coinfest 2015
Ethereum Contracts - Coinfest 2015Ethereum Contracts - Coinfest 2015
Ethereum Contracts - Coinfest 2015Rhea Myers
 
Solidity Simple Tutorial EN
Solidity Simple Tutorial ENSolidity Simple Tutorial EN
Solidity Simple Tutorial ENNicholas Lin
 
Smart contracts in Solidity
Smart contracts in SoliditySmart contracts in Solidity
Smart contracts in SolidityFelix Crisan
 
Ethereum: Next steps...
Ethereum: Next steps...Ethereum: Next steps...
Ethereum: Next steps...gavofyork
 
Bazaar services
Bazaar servicesBazaar services
Bazaar servicesgavofyork
 
Relative truth
Relative truthRelative truth
Relative truthgavofyork
 
Polkadot prezo
Polkadot prezoPolkadot prezo
Polkadot prezogavofyork
 
ÐΞVcon: Introduction
ÐΞVcon: IntroductionÐΞVcon: Introduction
ÐΞVcon: Introductiongavofyork
 
The world computer general
The world computer generalThe world computer general
The world computer generalgavofyork
 
The world computer (short)
The world computer (short)The world computer (short)
The world computer (short)gavofyork
 
Blockchain what and why-
Blockchain  what and why-Blockchain  what and why-
Blockchain what and why-gavofyork
 
So now we've built Ethereum, WTF is it?
So now we've built Ethereum, WTF is it?So now we've built Ethereum, WTF is it?
So now we've built Ethereum, WTF is it?gavofyork
 
Where can smart contracts take us?
Where can smart contracts take us?Where can smart contracts take us?
Where can smart contracts take us?gavofyork
 
Conceptualizing Smart Contracts
Conceptualizing Smart ContractsConceptualizing Smart Contracts
Conceptualizing Smart ContractsAaron Wright
 
Blockchain, ethereum and polkadot
Blockchain, ethereum and polkadotBlockchain, ethereum and polkadot
Blockchain, ethereum and polkadotgavofyork
 
Ethereum: From there to here, and ownards yonder
Ethereum: From there to here, and ownards yonderEthereum: From there to here, and ownards yonder
Ethereum: From there to here, and ownards yondergavofyork
 
Blockchain - Introduction and Authoring Smart Contracts
Blockchain - Introduction and Authoring Smart ContractsBlockchain - Introduction and Authoring Smart Contracts
Blockchain - Introduction and Authoring Smart ContractsVikas Grover
 
Basic ethereum
Basic ethereumBasic ethereum
Basic ethereumgavofyork
 

Viewers also liked (20)

Ethereum Contracts - Coinfest 2015
Ethereum Contracts - Coinfest 2015Ethereum Contracts - Coinfest 2015
Ethereum Contracts - Coinfest 2015
 
Solidity Simple Tutorial EN
Solidity Simple Tutorial ENSolidity Simple Tutorial EN
Solidity Simple Tutorial EN
 
Smart contracts in Solidity
Smart contracts in SoliditySmart contracts in Solidity
Smart contracts in Solidity
 
Ethereum: Next steps...
Ethereum: Next steps...Ethereum: Next steps...
Ethereum: Next steps...
 
Bazaar services
Bazaar servicesBazaar services
Bazaar services
 
Crypto-law
Crypto-lawCrypto-law
Crypto-law
 
Relative truth
Relative truthRelative truth
Relative truth
 
Allegality
AllegalityAllegality
Allegality
 
Polkadot prezo
Polkadot prezoPolkadot prezo
Polkadot prezo
 
ÐΞVcon: Introduction
ÐΞVcon: IntroductionÐΞVcon: Introduction
ÐΞVcon: Introduction
 
The world computer general
The world computer generalThe world computer general
The world computer general
 
The world computer (short)
The world computer (short)The world computer (short)
The world computer (short)
 
Blockchain what and why-
Blockchain  what and why-Blockchain  what and why-
Blockchain what and why-
 
So now we've built Ethereum, WTF is it?
So now we've built Ethereum, WTF is it?So now we've built Ethereum, WTF is it?
So now we've built Ethereum, WTF is it?
 
Where can smart contracts take us?
Where can smart contracts take us?Where can smart contracts take us?
Where can smart contracts take us?
 
Conceptualizing Smart Contracts
Conceptualizing Smart ContractsConceptualizing Smart Contracts
Conceptualizing Smart Contracts
 
Blockchain, ethereum and polkadot
Blockchain, ethereum and polkadotBlockchain, ethereum and polkadot
Blockchain, ethereum and polkadot
 
Ethereum: From there to here, and ownards yonder
Ethereum: From there to here, and ownards yonderEthereum: From there to here, and ownards yonder
Ethereum: From there to here, and ownards yonder
 
Blockchain - Introduction and Authoring Smart Contracts
Blockchain - Introduction and Authoring Smart ContractsBlockchain - Introduction and Authoring Smart Contracts
Blockchain - Introduction and Authoring Smart Contracts
 
Basic ethereum
Basic ethereumBasic ethereum
Basic ethereum
 

Similar to Solidity

ERC20 Token Contract
ERC20 Token ContractERC20 Token Contract
ERC20 Token ContractKC Tam
 
From CRUD to messages: a true story
From CRUD to messages: a true storyFrom CRUD to messages: a true story
From CRUD to messages: a true storyAlessandro Melchiori
 
Hello world contract
Hello world contractHello world contract
Hello world contractGene Leybzon
 
2.overview of c++ ________lecture2
2.overview of c++  ________lecture22.overview of c++  ________lecture2
2.overview of c++ ________lecture2Warui Maina
 
Smart Contracts with Solidity hands-on training session
Smart Contracts with Solidity hands-on training session  Smart Contracts with Solidity hands-on training session
Smart Contracts with Solidity hands-on training session Gene Leybzon
 
Smart Contract programming 101 with Solidity #PizzaHackathon
Smart Contract programming 101 with Solidity #PizzaHackathonSmart Contract programming 101 with Solidity #PizzaHackathon
Smart Contract programming 101 with Solidity #PizzaHackathonSittiphol Phanvilai
 
Lab 10 sem ii_12_13
Lab 10 sem ii_12_13Lab 10 sem ii_12_13
Lab 10 sem ii_12_13alish sha
 
1. DSA - Introduction.pptx
1. DSA - Introduction.pptx1. DSA - Introduction.pptx
1. DSA - Introduction.pptxhara69
 
Smart contract and Solidity
Smart contract and SoliditySmart contract and Solidity
Smart contract and Solidity겨울 정
 
Computer-programming-User-defined-function-1.pptx
Computer-programming-User-defined-function-1.pptxComputer-programming-User-defined-function-1.pptx
Computer-programming-User-defined-function-1.pptxJohnRehldeGracia
 
“Create your own cryptocurrency in an hour” - Sandip Pandey
“Create your own cryptocurrency in an hour” - Sandip Pandey“Create your own cryptocurrency in an hour” - Sandip Pandey
“Create your own cryptocurrency in an hour” - Sandip PandeyEIT Digital Alumni
 
Clean Architecture
Clean ArchitectureClean Architecture
Clean ArchitectureBadoo
 
Developer Experience i TypeScript. Najbardziej ikoniczne duo
Developer Experience i TypeScript. Najbardziej ikoniczne duoDeveloper Experience i TypeScript. Najbardziej ikoniczne duo
Developer Experience i TypeScript. Najbardziej ikoniczne duoThe Software House
 
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo JobyC++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo JobyGrejoJoby1
 
Community-driven Language Design at TC39 on the JavaScript Pipeline Operator ...
Community-driven Language Design at TC39 on the JavaScript Pipeline Operator ...Community-driven Language Design at TC39 on the JavaScript Pipeline Operator ...
Community-driven Language Design at TC39 on the JavaScript Pipeline Operator ...Igalia
 
Jarmo van de Seijp Shadbox ERC223
Jarmo van de Seijp Shadbox ERC223Jarmo van de Seijp Shadbox ERC223
Jarmo van de Seijp Shadbox ERC223Jarmo van de Seijp
 
Analysis of Microsoft Code Contracts
Analysis of Microsoft Code ContractsAnalysis of Microsoft Code Contracts
Analysis of Microsoft Code ContractsPVS-Studio
 
12th CBSE Practical File
12th CBSE Practical File12th CBSE Practical File
12th CBSE Practical FileAshwin Francis
 
C++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptxC++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptxssuser3cbb4c
 

Similar to Solidity (20)

ERC20 Token Contract
ERC20 Token ContractERC20 Token Contract
ERC20 Token Contract
 
From CRUD to messages: a true story
From CRUD to messages: a true storyFrom CRUD to messages: a true story
From CRUD to messages: a true story
 
Hello world contract
Hello world contractHello world contract
Hello world contract
 
2.overview of c++ ________lecture2
2.overview of c++  ________lecture22.overview of c++  ________lecture2
2.overview of c++ ________lecture2
 
Smart Contracts with Solidity hands-on training session
Smart Contracts with Solidity hands-on training session  Smart Contracts with Solidity hands-on training session
Smart Contracts with Solidity hands-on training session
 
Smart Contract programming 101 with Solidity #PizzaHackathon
Smart Contract programming 101 with Solidity #PizzaHackathonSmart Contract programming 101 with Solidity #PizzaHackathon
Smart Contract programming 101 with Solidity #PizzaHackathon
 
C sharp 8
C sharp 8C sharp 8
C sharp 8
 
Lab 10 sem ii_12_13
Lab 10 sem ii_12_13Lab 10 sem ii_12_13
Lab 10 sem ii_12_13
 
1. DSA - Introduction.pptx
1. DSA - Introduction.pptx1. DSA - Introduction.pptx
1. DSA - Introduction.pptx
 
Smart contract and Solidity
Smart contract and SoliditySmart contract and Solidity
Smart contract and Solidity
 
Computer-programming-User-defined-function-1.pptx
Computer-programming-User-defined-function-1.pptxComputer-programming-User-defined-function-1.pptx
Computer-programming-User-defined-function-1.pptx
 
“Create your own cryptocurrency in an hour” - Sandip Pandey
“Create your own cryptocurrency in an hour” - Sandip Pandey“Create your own cryptocurrency in an hour” - Sandip Pandey
“Create your own cryptocurrency in an hour” - Sandip Pandey
 
Clean Architecture
Clean ArchitectureClean Architecture
Clean Architecture
 
Developer Experience i TypeScript. Najbardziej ikoniczne duo
Developer Experience i TypeScript. Najbardziej ikoniczne duoDeveloper Experience i TypeScript. Najbardziej ikoniczne duo
Developer Experience i TypeScript. Najbardziej ikoniczne duo
 
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo JobyC++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
 
Community-driven Language Design at TC39 on the JavaScript Pipeline Operator ...
Community-driven Language Design at TC39 on the JavaScript Pipeline Operator ...Community-driven Language Design at TC39 on the JavaScript Pipeline Operator ...
Community-driven Language Design at TC39 on the JavaScript Pipeline Operator ...
 
Jarmo van de Seijp Shadbox ERC223
Jarmo van de Seijp Shadbox ERC223Jarmo van de Seijp Shadbox ERC223
Jarmo van de Seijp Shadbox ERC223
 
Analysis of Microsoft Code Contracts
Analysis of Microsoft Code ContractsAnalysis of Microsoft Code Contracts
Analysis of Microsoft Code Contracts
 
12th CBSE Practical File
12th CBSE Practical File12th CBSE Practical File
12th CBSE Practical File
 
C++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptxC++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptx
 

More from gavofyork

Governance in Polkadot PoC-3
Governance in Polkadot PoC-3Governance in Polkadot PoC-3
Governance in Polkadot PoC-3gavofyork
 
Polkadot, Substrate and Governance (PoC-3)
Polkadot, Substrate and Governance (PoC-3)Polkadot, Substrate and Governance (PoC-3)
Polkadot, Substrate and Governance (PoC-3)gavofyork
 
Polkadot Presentation
Polkadot PresentationPolkadot Presentation
Polkadot Presentationgavofyork
 
Parity Progress Report
Parity Progress ReportParity Progress Report
Parity Progress Reportgavofyork
 
The world computer
The world computerThe world computer
The world computergavofyork
 
The Ethereum ÐApp IDE: Mix
The Ethereum ÐApp IDE: MixThe Ethereum ÐApp IDE: Mix
The Ethereum ÐApp IDE: Mixgavofyork
 
Ethereum: Coding Society
Ethereum: Coding SocietyEthereum: Coding Society
Ethereum: Coding Societygavofyork
 
Ethereum hackers
Ethereum hackersEthereum hackers
Ethereum hackersgavofyork
 
The Ethereum Experience
The Ethereum ExperienceThe Ethereum Experience
The Ethereum Experiencegavofyork
 
Academic Ethereum
Academic EthereumAcademic Ethereum
Academic Ethereumgavofyork
 
Berlinbetahaus
BerlinbetahausBerlinbetahaus
Berlinbetahausgavofyork
 

More from gavofyork (12)

Governance in Polkadot PoC-3
Governance in Polkadot PoC-3Governance in Polkadot PoC-3
Governance in Polkadot PoC-3
 
Polkadot, Substrate and Governance (PoC-3)
Polkadot, Substrate and Governance (PoC-3)Polkadot, Substrate and Governance (PoC-3)
Polkadot, Substrate and Governance (PoC-3)
 
Polkadot Presentation
Polkadot PresentationPolkadot Presentation
Polkadot Presentation
 
Parity Progress Report
Parity Progress ReportParity Progress Report
Parity Progress Report
 
The world computer
The world computerThe world computer
The world computer
 
The Ethereum ÐApp IDE: Mix
The Ethereum ÐApp IDE: MixThe Ethereum ÐApp IDE: Mix
The Ethereum ÐApp IDE: Mix
 
Whisper
WhisperWhisper
Whisper
 
Ethereum: Coding Society
Ethereum: Coding SocietyEthereum: Coding Society
Ethereum: Coding Society
 
Ethereum hackers
Ethereum hackersEthereum hackers
Ethereum hackers
 
The Ethereum Experience
The Ethereum ExperienceThe Ethereum Experience
The Ethereum Experience
 
Academic Ethereum
Academic EthereumAcademic Ethereum
Academic Ethereum
 
Berlinbetahaus
BerlinbetahausBerlinbetahaus
Berlinbetahaus
 

Recently uploaded

Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 

Recently uploaded (20)

Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 

Solidity

  • 2. Problem Need people to write contracts. Correct contracts. Lots of people.
  • 3. Solutions Tend to be Web devs Syntax similar to JavaScript ...to minimise barriers to entry and leverage existing skillset
  • 4. Solutions Express common concepts clearly First-class contracts as classes ...for transparent integration and reuse Storage constructs ...for ease of contract STORE usage Variadic returns ...for ease of contract RETURN passing
  • 5. Solutions Make things likely to be correct Unit tests ...that are easier to use than not Formal proofing ...that makes statements guaranteed always true
  • 6. Solutions Documentation fundamental Inbuilt documentation system (See later talk)
  • 7. Contracts as first-class citizens contract StoreNumber { void set(uint n) { ... } uint get() const { ... } ... } contract Other { Other() { StoreNumber s = ...; s.set(69); ... uint n = s.get(); } }
  • 8. (Easy) Storage Facilities contract StoreNumber { function set(uint n) { m_n = n; } function get() const returns (uint) { return m_n; } uint m_n; }
  • 9. (Easy) Storage Facilities struct Endpoint { uint32 ipv4; uint16 port; } contract Endpoints { function set(uint32 _ipv4, uint16 _port) { var end = new Endpoint({ipv4: _ipv4, port: _port}); m_ends[msg.caller] = end; } function kill() { delete m_ends[msg.caller]; } mapping { address => Endpoint } m_ends; }
  • 10. Variadic Returns contract Endpoints { function set(uint32 _ipv4, uint16 _port) { var end = new Endpoint({ipv4: _ipv4, port: _port}); m_ends[msg.caller] = end; } function kill() { delete m_ends[msg.caller]; } function get(address _a) const returns (uint32, uint16) { return m_ends[_a]; } mapping { address => Endpoint } m_ends; }
  • 11. Formal Proofing contract Cash { function give(address _a, uint32 _amount) { if (m_balances[msg.caller] >= _amount) { m_balances[msg.caller] -= _amount; m_balances[_a] += _amount; } } function balance(address _a) const returns (uint32) { return m_balances[_a]; } mapping { address => uint64 } m_balances; construction: m_balances[msg.caller] = 1000000000; invariant: reduce(+, map(valueOf, m_balances)) == 1000000000; }
  • 12. Inbuilt Docs (NatSpec) contract Cash { /// Transfers `_amount` cash from your account /// `msg.caller` to the account controlled by `_a`. function give(address _a, uint32 _amount) { if (m_balances[msg.caller] >= _amount) { m_balances[msg.caller] -= _amount; m_balances[_a] += _amount; } } /// Returns the amount of cash controlled by account /// `_a`. function balance(address _a) const returns (uint32) { return m_balances[_a]; } mapping { address => uint64 } m_balances; construction: /// Creator of contract is endowed with balance of /// 1000000000. m_balances[msg.caller] = 1000000000; invariant: /// Total cash in system is always 1000000000. reduce(+, map(valueOf, m_balances)) == 1000000000; }
  • 13. Solidity What and Why Over to Christian