SlideShare a Scribd company logo
3. Solidity Contract, Compilation and
Deployment (Concept)
KC Tam
Reach KC on LinkedIn: https://www.linkedin.com/in/ktam1/
Objective
We first take a glimpse in the SimpleStorage Contract and
understand a bit how Solidity Contract looks like. Then we
will get some ideas on contract compilation and deployment,
and how application is accessing the deployed contract.
A Typical Solidity Contract
Human readable
Define the business logic we wish to implement in Ethereum Network (remember,
this is just a giant computer)
A Solidity Contract is roughly composed of these parts,
● Solidity version for proper compilation
● Variables and data structures storing data
● Functions to process the data
pragma solidity ^0.4.0;
contract SimpleStorage {
uint storedData;
function set(uint x) public {
storedData = x;
}
function get() constant public returns (uint retVal) {
return storedData;
}
}
Source: https://solidity.readthedocs.io/en/develop/introduction-to-smart-contracts.html
Contract name
SimpleStorage
variable storedData in Ethereum
Network that stores the value
function set(x) to modify the value
of storedData stored in the
Ethereum Network
function get() to retrieve the value
of storedData stored in the
Ethereum Network
Solidity Contract
Gigantic Computer
Contract
code in
Solidity
Artifacts
(Bytecode
and ABI)
Deployed
Contract
(accessible)
Compile Deploy
Web / Mobile Frontend
Access
Contract Code in
Solidity
artifact
ABI
Bytecode
Compilation
Bytecode: machine-readable code to be deployed on Ethereum Network
Application Binary Interface (ABI): the interface between application
and bytecode deployed on Ethereum Network
Compile
Artifact of SimpleStorage
ABI
[{"constant":false,"inputs":[{"name":"x","type":"uint256"}],"name":"set","outputs
":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant
":true,"inputs":[],"name":"get","outputs":[{"name":"retVal","type":"uint256"}],"pa
yable":false,"stateMutability":"view","type":"function"}]
Bytecode
"6060604052341561000f57600080fd5b60d38061001d6000396000f3006060
604052600436106049576000357c010000000000000000000000000000000
0000000000000000000000000900463ffffffff16806360fe47b114604e5780636
d4ce63c14606e575b600080fd5b3415605857600080fd5b606c600480803590
60200190919050506094565b005b3415607857600080fd5b607e609e565b60
40518082815260200191505060405180910390f35b8060008190555050565b
600080549050905600a165627a7a72305820aa1702bf13d58014043cd19825
b6024d08ca61876e492bd169a100f816489ea90029"
Note: Compiled contract code (artifact) is NOT deployed yet. It cannot be used or accessed
until it is deployed on an Ethereum Network and a Contract Address is obtained.
Ethereum Network (the Giant Computer)
artifact
ABI
Bytecode
Contract Deployment
● Artifact is deployed on an Ethereum
Network.
● An address (Contract Address) is given to
this deployed contract.
● Deployed contract is identified by this
Contract Address.
Deployed Contract
Bytecode
ABI
Contract
Address
Deploy
Ethereum Network (the Giant Computer)
artifact
ABI
Bytecode
Contract Deployment
● An artifact can be deployed as many times
as one wishes.
● This newly deployed contract is given with a
different Contract Address.
● These contracts are isolated to one
another.
Deployed Contract
Bytecode
ABI
Contract
Address
Deploy
Deployed Contract
Bytecode
Contract
Address
ABI
Ethereum Network (the Giant Computer)
Access Contract
● Frontend accesses the deployed contract
through Contract Address.
● With ABI well defined, frontend can access
variables and execute contract functions in
this deployed contract.
Deployed Contract
Bytecode
ABI
Contract
Address
Web / Mobile Frontend
Contract AddressABI
Access
Summary
We have seen how a simple Solidity contract looks like. We
also covered the concepts of code compilation and
deployment on Ethereum Network, and how frontend
accesses the deployed contract.

More Related Content

TXT
S7 1200 web server tutorial
PDF
Use Geth to Deploy Contract
PPTX
以太坊代幣付款委託 @ Open Source Developer Meetup #12
PDF
Evolving your Data Access with MongoDB Stitch
PDF
Letswift18 워크숍#1 스위프트 클린코드와 코드리뷰
PDF
A Decompiler for Blackhain-Based Smart Contracts Bytecode
PPTX
Developing your first application using FIWARE
PPT
Bigger Stronger Faster
S7 1200 web server tutorial
Use Geth to Deploy Contract
以太坊代幣付款委託 @ Open Source Developer Meetup #12
Evolving your Data Access with MongoDB Stitch
Letswift18 워크숍#1 스위프트 클린코드와 코드리뷰
A Decompiler for Blackhain-Based Smart Contracts Bytecode
Developing your first application using FIWARE
Bigger Stronger Faster

Similar to Solidity Contract: the code, compilation, deployment and accessing (20)

PPTX
MongoDB.local Sydney: Evolving your Data Access with MongoDB Stitch
PPTX
Developing your first application using FI-WARE
PDF
How to Start Building in Web3 – Smart Contract Design & Development Part 1
PDF
How to be a smart contract engineer
PPTX
Oracles
PPTX
Oracles
PDF
droidQuery: The Android port of jQuery
PDF
MongoDB Stitch Tutorial
PDF
Scalable Angular 2 Application Architecture
PDF
Open Policy Agent (OPA) と Kubernetes Policy
PDF
Manipulating object-behavior-at-runtime
PPTX
SenchaCon 2016: Handle Real-World Data with Confidence - Fredric Berling
PPTX
Cloud Computing for Business - The Road to IT-as-a-Service
PPTX
MongoDB.local Atlanta: Introduction to Serverless MongoDB
PDF
Clean Architecture @ Taxibeat
PDF
Coding Ajax
PDF
Node.js for enterprise - JS Conference
PDF
Coding Ajax
PPT
introduction to Windows Comunication Foundation
PPTX
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
MongoDB.local Sydney: Evolving your Data Access with MongoDB Stitch
Developing your first application using FI-WARE
How to Start Building in Web3 – Smart Contract Design & Development Part 1
How to be a smart contract engineer
Oracles
Oracles
droidQuery: The Android port of jQuery
MongoDB Stitch Tutorial
Scalable Angular 2 Application Architecture
Open Policy Agent (OPA) と Kubernetes Policy
Manipulating object-behavior-at-runtime
SenchaCon 2016: Handle Real-World Data with Confidence - Fredric Berling
Cloud Computing for Business - The Road to IT-as-a-Service
MongoDB.local Atlanta: Introduction to Serverless MongoDB
Clean Architecture @ Taxibeat
Coding Ajax
Node.js for enterprise - JS Conference
Coding Ajax
introduction to Windows Comunication Foundation
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
Ad

More from KC Tam (9)

PDF
Access Tokens from Metamask
PDF
Implement ERC20 on TestRPC
PDF
ERC20 Token Contract
PDF
Ethereum: Native Currency and Token
PDF
Use Geth to Access a Deployed Contract
PDF
Use TestRPC in Remix
PDF
Contract Practice with Remix
PDF
Access a Simple DApp
PDF
Essential Ethereum
Access Tokens from Metamask
Implement ERC20 on TestRPC
ERC20 Token Contract
Ethereum: Native Currency and Token
Use Geth to Access a Deployed Contract
Use TestRPC in Remix
Contract Practice with Remix
Access a Simple DApp
Essential Ethereum
Ad

Recently uploaded (20)

PPTX
A Presentation on Artificial Intelligence
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
Approach and Philosophy of On baking technology
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PPTX
TLE Review Electricity (Electricity).pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
A Presentation on Artificial Intelligence
Group 1 Presentation -Planning and Decision Making .pptx
Encapsulation_ Review paper, used for researhc scholars
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
DP Operators-handbook-extract for the Mautical Institute
Approach and Philosophy of On baking technology
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
A comparative analysis of optical character recognition models for extracting...
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
WOOl fibre morphology and structure.pdf for textiles
1 - Historical Antecedents, Social Consideration.pdf
Encapsulation theory and applications.pdf
Enhancing emotion recognition model for a student engagement use case through...
A comparative study of natural language inference in Swahili using monolingua...
Heart disease approach using modified random forest and particle swarm optimi...
TLE Review Electricity (Electricity).pptx
Building Integrated photovoltaic BIPV_UPV.pdf
Univ-Connecticut-ChatGPT-Presentaion.pdf
MIND Revenue Release Quarter 2 2025 Press Release

Solidity Contract: the code, compilation, deployment and accessing