SlideShare a Scribd company logo
Smart contracts on Ethereum
Getting started
DappsMedia Tomoaki Sato
June 2015
Main source: https://github.com/ethereum/wiki/wiki/Ethereum-Development-Tutorial
~From blockchain installation to make tokenContract ~
What are smart contracts on Ethereum blockchain?
1Source: https://github.com/ethereum/wiki/wiki/White-Paper
Original idea derived from Nick Szabo’s paper in1997.
http://szabo.best.vwh.net/smart_contracts_idea.html
and going to be live by Stateful blockchain with Ethereum virtual machine
What kind of application needs smart contracts ?
2Source: Source
1.Vending machine
2.Asset automated transfer system
• Token Systems
• Financial derivatives
• Identity and Reputation Systems
• Decentralized File Storage
• Decentralized Autonomous
Organizations
• See also
https://docs.google.com/spreads
heets/u/1/d/1VdRMFENPzjL2V-
vZhcc_aa5-
ysf243t5vXlxC2b054g/edit
After blockchain age
Smart contract 4 purposes
3
Smart contract
1. Maintain a data
store contract.
2. Forwarding
contract which
has access policy,
and some
conditions to
send messages.
3. Ongoing
contract such as
escrow,
crowdfunding.
4.Library type
contract which
provides
functions to other
contracts.
Process objectives
Ethereum contracts objectives
Source: https://github.com/ethereum/wiki/wiki/Ethereum-Development-Tutorial
1.Maintain a data store contract
4
Most simple type can be used by Embark (more about the later)
Source: http://jorisbontje.github.io/sleth/#/
# app/contracts/simple_storage.sol
contract SimpleStorage {
uint storedData;
function set(uint x) {
storedData = x * x * x;
}
function get() constant returns (uint retVal)
{
return storedData;
}
}
2.Forwarding contract
5
Sleth is the decentralized slot machine application using forwarding type smart contract.
Currently I can not find the forwarding type contract which can be run on testnet. If you know please comment on.
Source: https://github.com/ethereum/wiki/wiki/Ethereum-Development-Tutorial
When Bob wants to finalize the bet, the following
steps happen:
1. A transaction is sent, triggering a message
from Bob's EOA to Bob's forwarding contract.
2. Bob's forwarding contract sends the hash of
the message and the Lamport signature to a
contract which functions as a Lamport
signature verification library.
3. The Lamport signature verification library sees
that Bob wants a SHA256-based Lamport sig,
so it calls the SHA256 library many times as
needed to verify the signature.
4. Once the Lamport signature verification library
returns 1, signifying that the signature has
been verified, it sends a message to the
contract representing the bet.
5. The bet contract checks the contract providing
the San Francisco temperature to see what the
temperature is.
3.Ongoing contract
6Source: https://github.com/WeiFund/WeiFund/blob/master/WeiFund.sol
Most smart contracts are ongoing type contracts, such as crowdfunding is ongoing contract.
// WeiFund System
// Start, donate, payout and refund crowdfunding campaigns
// @authors:
// Nick Dodson <thenickdodson@gmail.com>
// If goal is not reached and campaign is expired, contributers can get the
refunded individually
// If goal is reached by alloted time, contributions can still be made
contract WeiFundConfig
{
function onContribute(uint cid, address addr, uint amount){}
function onRefund(uint cid, address addr, uint amount){}
function onPayout(uint cid, uint amount){}
}
contract WeiFund
{
struct User
{
uint numCampaigns;
mapping(uint => uint) campaigns;
}
struct Funder
{
address addr;
uint amount;
}
...
4. Library contract
7Source: https://github.com/ethereum/wiki/wiki/Ethereum-Development-Tutorial
Smart contract which provides utility functions.
In the case below, Lamport sig verifier contract is Library type contracts.
The contract will provide a set of function
Structuring every type of smart contract
8
You can make structure by combining different contracts
Source:https://github.com/ethereum/wiki/wiki/Ethereum-Development-Tutorial
LET’S ENJOY ETHEREUM
Next
9
Our goal today
10
Download blockchain, writing smart contracts, publish contract on blockchain, send message to
contracts.
Source: http://jorisbontje.github.io/sleth/#/ http://ethereum.gitbooks.io/frontier-guide/content/contract_coin.html
http://meteor-dapp-cosmo.meteor.com/
Cool!
1. Install Ethereum blockchain 2.writing smart contract
3.Publish contract on blockchain 4.Send message to contracts &
check the result
tokenInstance.getBalance.call(eth.accounts[1])
tokenInstance.sendToken.sendTransaction(et
h.accounts[1], 100, {from: eth.accounts[0]})
1. Install Ethereum blockchain
11
3 ways to install...
Source: http://jorisbontje.github.io/sleth/#/
1. Live Testnet chain https://stats.ethdev.com/
2. Private chain
3. Private chain with framework (Embark framework)
https://github.com/iurimatias/embark-framework
Cool!
1. Install Ethereum blockchain
12Source: http://jorisbontje.github.io/sleth/#/
1. Live Testnet chain we will install this chain. https://stats.ethdev.com/
Cool!
CPP
O △ ☓
1. Install Ethereum blockchain
13Source:
1.Live Testnet chain we will install this chain. https://stats.ethdev.com/
June, 2015
Go-Ethereum = Geth !
1. installation of geth
https://github.com/ethereum/go-ethereum/releases/tag/v0.9.20
2. geth account new
http://ethereum.gitbooks.io/frontier-guide/content/creating_accounts.html
3. Do mining & should wait until the Blocknumber on stats (roughly 4 ~6 hours )
https://stats.ethdev.com/
1. Install Ethereum blockchain
14
2.Private chain is private blockchain just for you. No network, your own blockchain.
Source:https://github.com/ethereum/go-ethereum/wiki/Setting-up-private-network-or-local-cluster
Currently Ethereum using blockchain,
You can run multiple chains locally to do this,
1. Each instance has separate data dir
2. Each instance runs on a different port ( both eth and rpc. )
3. The instances know about each other
You can run multiple chains locally
1st chain
// create dir for blockchain
$ mkdir /tmp/eth/60/01
// run private chain
$ geth –datadir=“/tmp/eth/60/01” –
verbosity 6 –port 30301 –rpcport 8101
console 2>> /tmp/eth/60/01.log
// mining start
$ admin.miner.start()
You can run multiple chains locally
2nd chain but for my env doesn’t work.
// create dir for blockchain
$ mkdir /tmp/eth/61/01
// run private chain
$ geth –datadir=“/tmp/eth/61/01” –
verbosity 6 –port 30302 –rpcport 8102
console 2>> /tmp/eth/61/01.log
// mining start
$ admin.miner.start()
1. Install Ethereum blockchain
15
3. Embark Framework for Ethereum DApps. https://iurimatias.github.io/embark-framework/
Source: https://iurimatias.github.io/embark-framework/
I feel
1. Easy to upload contracts you write to private blockchain
2. If you don’t know about How to use
3. Fast demo – Simple storage application using private chain is buildin demo.
$ npm install -g embark-framework grunt-cli
$ embark demo
$ cd embark_demo
$ embark blockchain
$ embark run
2. Write smart contract after $ geth console
16
1. Write Token contract you can publish your own token. After $ geth console
### coin contract from console
var tokenSource = 'contract token { mapping (address => uint) balances; function token() { balances[msg.sender]
= 10000; } function sendToken(address receiver, uint amount) returns(bool sufficient) { if
(balances[msg.sender] < amount) return false; balances[msg.sender] -= amount; balances[receiver] +=
amount; return true; } function getBalance(address account) returns(uint balance){ return
balances[account]; } }'
var tokenCompiled = eth.compile.solidity(tokenSource).token
var tokenAddress = eth.sendTransaction({data: tokenCompiled.code, from: eth.accounts[0], gas:1000000});
admin.miner.start()
admin.miner.stop()
eth.getCode(tokenAddress)
tokenContract = eth.contract(tokenCompiled.info.abiDefinition)
tokenInstance = tokenContract.at(tokenAddress);
> tokenInstance
{
address: '0xf95ff51f532bd6821b98f312e876e1e2213f3e36',
sendToken: [Function],
getBalance: [Function]
}
tokenInstance.getBalance.call(eth.accounts[0])
tokenInstance.sendToken.sendTransaction(eth.accounts[1], 100, {from: eth.accounts[0]})
admin.miner.start()
admin.miner.stop()
tokenInstance.getBalance.call(eth.accounts[0])
> tokenInstance.getBalance.call(eth.accounts[0])
'9900'
3.Publish contract
17
This phrase is uploading the contract onto blockchain.
### coin contract from console
var tokenSource = 'contract token { mapping (address => uint) balances; function token() { balances[msg.sender]
= 10000; } function sendToken(address receiver, uint amount) returns(bool sufficient) { if
(balances[msg.sender] < amount) return false; balances[msg.sender] -= amount; balances[receiver] +=
amount; return true; } function getBalance(address account) returns(uint balance){ return
balances[account]; } }'
var tokenCompiled = eth.compile.solidity(tokenSource).token
var tokenAddress = eth.sendTransaction({data: tokenCompiled.code, from:
eth.accounts[0], gas:1000000});
admin.miner.start()
admin.miner.stop()
eth.getCode(tokenAddress)
tokenContract = eth.contract(tokenCompiled.info.abiDefinition)
tokenInstance = tokenContract.at(tokenAddress);
> tokenInstance
{
address: '0xf95ff51f532bd6821b98f312e876e1e2213f3e36',
sendToken: [Function],
getBalance: [Function]
}
tokenInstance.getBalance.call(eth.accounts[0])
tokenInstance.sendToken.sendTransaction(eth.accounts[1], 100, {from: eth.accounts[0]})
admin.miner.start()
admin.miner.stop()
tokenInstance.getBalance.call(eth.accounts[0])
> tokenInstance.getBalance.call(eth.accounts[0])
'9900'
4.Send message to the contract and check the result
18
This phrase is sending message to the contract on blockchain.
### coin contract from console
var tokenSource = 'contract token { mapping (address => uint) balances; function token() { balances[msg.sender]
= 10000; } function sendToken(address receiver, uint amount) returns(bool sufficient) { if
(balances[msg.sender] < amount) return false; balances[msg.sender] -= amount; balances[receiver] +=
amount; return true; } function getBalance(address account) returns(uint balance){ return
balances[account]; } }'
var tokenCompiled = eth.compile.solidity(tokenSource).token
var tokenAddress = eth.sendTransaction({data: tokenCompiled.code, from: eth.accounts[0], gas:1000000});
admin.miner.start()
admin.miner.stop()
eth.getCode(tokenAddress)
tokenContract = eth.contract(tokenCompiled.info.abiDefinition)
tokenInstance = tokenContract.at(tokenAddress);
> tokenInstance
{
address: '0xf95ff51f532bd6821b98f312e876e1e2213f3e36',
sendToken: [Function],
getBalance: [Function]
}
tokenInstance.getBalance.call(eth.accounts[0])
tokenInstance.sendToken.sendTransaction(eth.accounts[1], 100, {from:
eth.accounts[0]})
admin.miner.start()
admin.miner.stop()
tokenInstance.getBalance.call(eth.accounts[0])
> tokenInstance.getBalance.call(eth.accounts[0])
'9900'
Miscellaneous
19
Ethereum frontier guide
Solidty online compiler
https://chriseth.github.io/cpp-ethereum/
Geth(go-ethereum)
https://github.com/ethereum/go-ethereum/releases/tag/v0.9.20
State of the DApps spreadsheet
https://docs.google.com/spreadsheets/d/1VdRMFENPzjL2V-vZhcc_aa5-
ysf243t5vXlxC2b054g/edit#gid=0
Ethereum forum
https://forum.ethereum.org/categories/services-and-decentralized-applications
Solidity presentation
https://www.youtube.com/watch?v=DIqGDNPO5YM
http://ethereum.gitbooks.io/frontier-guide/content/creating_accounts.html
20
Decentralization is just beginning.
We hope you start to be involved in!
Do you have interested in the DAppsMedia also ?
If you have, contract us from here!

More Related Content

What's hot

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 introduction
Ethereum introductionEthereum introduction
Ethereum introduction
kesavan N B
 
Ethereum
EthereumEthereum
Ethereum
Brian Yap
 
Bitcoin, Ethereum, Smart Contract & Blockchain
Bitcoin, Ethereum, Smart Contract & BlockchainBitcoin, Ethereum, Smart Contract & Blockchain
Bitcoin, Ethereum, Smart Contract & Blockchain
Jitendra Chittoda
 
The Blockchain and JavaScript
The Blockchain and JavaScriptThe Blockchain and JavaScript
The Blockchain and JavaScript
Portia Burton
 
Introduction to Ethereum
Introduction to EthereumIntroduction to Ethereum
Introduction to Ethereum
Terek Judi
 
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
 
BCHGraz - Meetup #8 - Intro & Ethereum
 BCHGraz - Meetup #8 - Intro & Ethereum BCHGraz - Meetup #8 - Intro & Ethereum
BCHGraz - Meetup #8 - Intro & Ethereum
BlockchainHub Graz
 
Blockchain, Ethereum and ConsenSys
Blockchain, Ethereum and ConsenSysBlockchain, Ethereum and ConsenSys
Blockchain, Ethereum and ConsenSys
WithTheBest
 
Eclipsecon Europe: Blockchain, Ethereum and Business Applications
Eclipsecon Europe: Blockchain, Ethereum and Business ApplicationsEclipsecon Europe: Blockchain, Ethereum and Business Applications
Eclipsecon Europe: Blockchain, Ethereum and Business Applications
Matthias Zimmermann
 
Ethereum Devcon1 Report (summary writing)
Ethereum Devcon1 Report (summary writing)Ethereum Devcon1 Report (summary writing)
Ethereum Devcon1 Report (summary writing)
Tomoaki Sato
 
The Ethereum Experience
The Ethereum ExperienceThe Ethereum Experience
The Ethereum Experience
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
Truong Nguyen
 
gething started - ethereum & using the geth golang client
gething started - ethereum & using the geth golang clientgething started - ethereum & using the geth golang client
gething started - ethereum & using the geth golang client
Sathish VJ
 
Every thing bitcoin in baby language
Every thing bitcoin in baby languageEvery thing bitcoin in baby language
Every thing bitcoin in baby language
Ossai Nduka
 
Bitcoin and Ethereum
Bitcoin and EthereumBitcoin and Ethereum
Bitcoin and Ethereum
Jongseok Choi
 
Smart contractjp smartcontract_about
Smart contractjp smartcontract_aboutSmart contractjp smartcontract_about
Smart contractjp smartcontract_about
Tomoaki Sato
 
Blockchain Programming
Blockchain ProgrammingBlockchain Programming
Blockchain Programming
Rhea Myers
 
Bitcoin in a Nutshell
Bitcoin in a NutshellBitcoin in a Nutshell
Bitcoin in a Nutshell
Daniel Chan
 
create your own cryptocurrency
create your own cryptocurrencycreate your own cryptocurrency
create your own cryptocurrency
Bellaj Badr
 

What's hot (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 introduction
Ethereum introductionEthereum introduction
Ethereum introduction
 
Ethereum
EthereumEthereum
Ethereum
 
Bitcoin, Ethereum, Smart Contract & Blockchain
Bitcoin, Ethereum, Smart Contract & BlockchainBitcoin, Ethereum, Smart Contract & Blockchain
Bitcoin, Ethereum, Smart Contract & Blockchain
 
The Blockchain and JavaScript
The Blockchain and JavaScriptThe Blockchain and JavaScript
The Blockchain and JavaScript
 
Introduction to Ethereum
Introduction to EthereumIntroduction to Ethereum
Introduction to Ethereum
 
Building Apps with Ethereum Smart Contract
Building Apps with Ethereum Smart ContractBuilding Apps with Ethereum Smart Contract
Building Apps with Ethereum Smart Contract
 
BCHGraz - Meetup #8 - Intro & Ethereum
 BCHGraz - Meetup #8 - Intro & Ethereum BCHGraz - Meetup #8 - Intro & Ethereum
BCHGraz - Meetup #8 - Intro & Ethereum
 
Blockchain, Ethereum and ConsenSys
Blockchain, Ethereum and ConsenSysBlockchain, Ethereum and ConsenSys
Blockchain, Ethereum and ConsenSys
 
Eclipsecon Europe: Blockchain, Ethereum and Business Applications
Eclipsecon Europe: Blockchain, Ethereum and Business ApplicationsEclipsecon Europe: Blockchain, Ethereum and Business Applications
Eclipsecon Europe: Blockchain, Ethereum and Business Applications
 
Ethereum Devcon1 Report (summary writing)
Ethereum Devcon1 Report (summary writing)Ethereum Devcon1 Report (summary writing)
Ethereum Devcon1 Report (summary writing)
 
The Ethereum Experience
The Ethereum ExperienceThe Ethereum Experience
The Ethereum Experience
 
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
 
gething started - ethereum & using the geth golang client
gething started - ethereum & using the geth golang clientgething started - ethereum & using the geth golang client
gething started - ethereum & using the geth golang client
 
Every thing bitcoin in baby language
Every thing bitcoin in baby languageEvery thing bitcoin in baby language
Every thing bitcoin in baby language
 
Bitcoin and Ethereum
Bitcoin and EthereumBitcoin and Ethereum
Bitcoin and Ethereum
 
Smart contractjp smartcontract_about
Smart contractjp smartcontract_aboutSmart contractjp smartcontract_about
Smart contractjp smartcontract_about
 
Blockchain Programming
Blockchain ProgrammingBlockchain Programming
Blockchain Programming
 
Bitcoin in a Nutshell
Bitcoin in a NutshellBitcoin in a Nutshell
Bitcoin in a Nutshell
 
create your own cryptocurrency
create your own cryptocurrencycreate your own cryptocurrency
create your own cryptocurrency
 

Viewers also liked

The Ethereum Geth Client
The Ethereum Geth ClientThe Ethereum Geth Client
The Ethereum Geth Client
Arnold Pham
 
Technological Unemployment and the Robo-Economy
Technological Unemployment and the Robo-EconomyTechnological Unemployment and the Robo-Economy
Technological Unemployment and the Robo-Economy
Melanie Swan
 
Dapps for Web Developers Aberdeen Techmeetup
Dapps for Web Developers Aberdeen TechmeetupDapps for Web Developers Aberdeen Techmeetup
Dapps for Web Developers Aberdeen Techmeetup
James Littlejohn
 
日本のIT市場のトピックス
日本のIT市場のトピックス日本のIT市場のトピックス
日本のIT市場のトピックス
Hiroyasu NOHATA
 
Ethereum @ descon 2016
Ethereum @ descon 2016Ethereum @ descon 2016
Ethereum @ descon 2016
Predrag Radović
 
Etherem ~ agvm
Etherem ~ agvmEtherem ~ agvm
Etherem ~ agvmgha sshee
 
Vision for a health blockchain
Vision for a health blockchainVision for a health blockchain
Vision for a health blockchain
James Littlejohn
 
Introduction to Idea
Introduction to IdeaIntroduction to Idea
Introduction to Idea
James Littlejohn
 
"Performance Analysis of In-Network Caching in Content-Centric Advanced Meter...
"Performance Analysis of In-Network Caching in Content-Centric Advanced Meter..."Performance Analysis of In-Network Caching in Content-Centric Advanced Meter...
"Performance Analysis of In-Network Caching in Content-Centric Advanced Meter...
Khaled Ben Driss
 
Solidity intro
Solidity introSolidity intro
Solidity intro
Angello Pozo
 
Etherisc Versicherung neu erfinden
Etherisc Versicherung neu erfindenEtherisc Versicherung neu erfinden
Etherisc Versicherung neu erfinden
Stephan Karpischek
 
The Ethereum ÐApp IDE: Mix
The Ethereum ÐApp IDE: MixThe Ethereum ÐApp IDE: Mix
The Ethereum ÐApp IDE: Mix
gavofyork
 
NodeJS Blockchain.info Wallet
NodeJS Blockchain.info WalletNodeJS Blockchain.info Wallet
NodeJS Blockchain.info Wallet
Sjors Provoost
 
Learning Solidity
Learning SolidityLearning Solidity
Learning Solidity
Arnold Pham
 
Ingredients for creating dapps
Ingredients for creating dappsIngredients for creating dapps
Ingredients for creating dapps
Stefaan Ponnet
 
V-Pesa
V-PesaV-Pesa
Chatbots et assistants virtuels : l'automatisation du poste de travail
Chatbots et assistants virtuels : l'automatisation du poste de travailChatbots et assistants virtuels : l'automatisation du poste de travail
Chatbots et assistants virtuels : l'automatisation du poste de travail
H2 University
 
Ethereum Madrid - Blockchain for dummies
Ethereum Madrid - Blockchain for dummiesEthereum Madrid - Blockchain for dummies
Ethereum Madrid - Blockchain for dummies
Ethereum Madrid
 
Ethereum Madrid - Cambio de paradigma en el sector energético
Ethereum Madrid - Cambio de paradigma en el sector energéticoEthereum Madrid - Cambio de paradigma en el sector energético
Ethereum Madrid - Cambio de paradigma en el sector energético
Ethereum Madrid
 

Viewers also liked (19)

The Ethereum Geth Client
The Ethereum Geth ClientThe Ethereum Geth Client
The Ethereum Geth Client
 
Technological Unemployment and the Robo-Economy
Technological Unemployment and the Robo-EconomyTechnological Unemployment and the Robo-Economy
Technological Unemployment and the Robo-Economy
 
Dapps for Web Developers Aberdeen Techmeetup
Dapps for Web Developers Aberdeen TechmeetupDapps for Web Developers Aberdeen Techmeetup
Dapps for Web Developers Aberdeen Techmeetup
 
日本のIT市場のトピックス
日本のIT市場のトピックス日本のIT市場のトピックス
日本のIT市場のトピックス
 
Ethereum @ descon 2016
Ethereum @ descon 2016Ethereum @ descon 2016
Ethereum @ descon 2016
 
Etherem ~ agvm
Etherem ~ agvmEtherem ~ agvm
Etherem ~ agvm
 
Vision for a health blockchain
Vision for a health blockchainVision for a health blockchain
Vision for a health blockchain
 
Introduction to Idea
Introduction to IdeaIntroduction to Idea
Introduction to Idea
 
"Performance Analysis of In-Network Caching in Content-Centric Advanced Meter...
"Performance Analysis of In-Network Caching in Content-Centric Advanced Meter..."Performance Analysis of In-Network Caching in Content-Centric Advanced Meter...
"Performance Analysis of In-Network Caching in Content-Centric Advanced Meter...
 
Solidity intro
Solidity introSolidity intro
Solidity intro
 
Etherisc Versicherung neu erfinden
Etherisc Versicherung neu erfindenEtherisc Versicherung neu erfinden
Etherisc Versicherung neu erfinden
 
The Ethereum ÐApp IDE: Mix
The Ethereum ÐApp IDE: MixThe Ethereum ÐApp IDE: Mix
The Ethereum ÐApp IDE: Mix
 
NodeJS Blockchain.info Wallet
NodeJS Blockchain.info WalletNodeJS Blockchain.info Wallet
NodeJS Blockchain.info Wallet
 
Learning Solidity
Learning SolidityLearning Solidity
Learning Solidity
 
Ingredients for creating dapps
Ingredients for creating dappsIngredients for creating dapps
Ingredients for creating dapps
 
V-Pesa
V-PesaV-Pesa
V-Pesa
 
Chatbots et assistants virtuels : l'automatisation du poste de travail
Chatbots et assistants virtuels : l'automatisation du poste de travailChatbots et assistants virtuels : l'automatisation du poste de travail
Chatbots et assistants virtuels : l'automatisation du poste de travail
 
Ethereum Madrid - Blockchain for dummies
Ethereum Madrid - Blockchain for dummiesEthereum Madrid - Blockchain for dummies
Ethereum Madrid - Blockchain for dummies
 
Ethereum Madrid - Cambio de paradigma en el sector energético
Ethereum Madrid - Cambio de paradigma en el sector energéticoEthereum Madrid - Cambio de paradigma en el sector energético
Ethereum Madrid - Cambio de paradigma en el sector energético
 

Similar to Dappsmedia smartcontract _write_smartcontracts_on_console_ethereum

Blockchain, Ethereum and Business Applications
Blockchain, Ethereum and Business ApplicationsBlockchain, Ethereum and Business Applications
Blockchain, Ethereum and Business Applications
Matthias Zimmermann
 
Kriptovaluták, hashbányászat és okoscicák
Kriptovaluták, hashbányászat és okoscicákKriptovaluták, hashbányászat és okoscicák
Kriptovaluták, hashbányászat és okoscicák
hackersuli
 
Ethereum bxl
Ethereum bxlEthereum bxl
Ethereum bxl
Benjamin MATEO
 
Blockchain School 2019 - Security of Smart Contracts.pdf
Blockchain School 2019 - Security of Smart Contracts.pdfBlockchain School 2019 - Security of Smart Contracts.pdf
Blockchain School 2019 - Security of Smart Contracts.pdf
Davide Carboni
 
Build on Streakk Chain - Blockchain
Build on Streakk Chain - BlockchainBuild on Streakk Chain - Blockchain
Build on Streakk Chain - Blockchain
Earn.World
 
Blockchain Chapter #4.pdf
Blockchain Chapter #4.pdfBlockchain Chapter #4.pdf
Blockchain Chapter #4.pdf
ssuser79c46d1
 
Ethereum Solidity Fundamentals
Ethereum Solidity FundamentalsEthereum Solidity Fundamentals
Ethereum Solidity Fundamentals
Eno Bassey
 
Blockchain
BlockchainBlockchain
Blockchain
Rishabh Sharma
 
Multi-Signature Crypto-Wallets: Nakov at Blockchain Berlin 2018
Multi-Signature Crypto-Wallets: Nakov at Blockchain Berlin 2018Multi-Signature Crypto-Wallets: Nakov at Blockchain Berlin 2018
Multi-Signature Crypto-Wallets: Nakov at Blockchain Berlin 2018
Svetlin Nakov
 
Blockchain for Developers
Blockchain for DevelopersBlockchain for Developers
Blockchain for Developers
Shimi Bandiel
 
Understanding blockchain
Understanding blockchainUnderstanding blockchain
Understanding blockchain
Priyab Satoshi
 
EthereumBlockchainMarch3 (1).pptx
EthereumBlockchainMarch3 (1).pptxEthereumBlockchainMarch3 (1).pptx
EthereumBlockchainMarch3 (1).pptx
WijdenBenothmen1
 
Ethereum Block Chain
Ethereum Block ChainEthereum Block Chain
Ethereum Block Chain
SanatPandoh
 
Bitcoin
BitcoinBitcoin
Bitcoin
ghanbarianm
 
Explain Ethereum smart contract hacking like i am a five
Explain Ethereum smart contract hacking like i am a fiveExplain Ethereum smart contract hacking like i am a five
Explain Ethereum smart contract hacking like i am a five
Zoltan Balazs
 
Zoltán Balázs - Ethereum Smart Contract Hacking Explained like I’m Five
Zoltán Balázs - Ethereum Smart Contract Hacking Explained like I’m FiveZoltán Balázs - Ethereum Smart Contract Hacking Explained like I’m Five
Zoltán Balázs - Ethereum Smart Contract Hacking Explained like I’m Five
hacktivity
 
Building a NFT Marketplace DApp
Building a NFT Marketplace DAppBuilding a NFT Marketplace DApp
Building a NFT Marketplace DApp
Thanh Nguyen
 
Building Java and Android apps on the blockchain
Building Java and Android apps on the blockchain Building Java and Android apps on the blockchain
Building Java and Android apps on the blockchain
Conor Svensson
 

Similar to Dappsmedia smartcontract _write_smartcontracts_on_console_ethereum (20)

Blockchain, Ethereum and Business Applications
Blockchain, Ethereum and Business ApplicationsBlockchain, Ethereum and Business Applications
Blockchain, Ethereum and Business Applications
 
Kriptovaluták, hashbányászat és okoscicák
Kriptovaluták, hashbányászat és okoscicákKriptovaluták, hashbányászat és okoscicák
Kriptovaluták, hashbányászat és okoscicák
 
Ethereum bxl
Ethereum bxlEthereum bxl
Ethereum bxl
 
Blockchain School 2019 - Security of Smart Contracts.pdf
Blockchain School 2019 - Security of Smart Contracts.pdfBlockchain School 2019 - Security of Smart Contracts.pdf
Blockchain School 2019 - Security of Smart Contracts.pdf
 
Build on Streakk Chain - Blockchain
Build on Streakk Chain - BlockchainBuild on Streakk Chain - Blockchain
Build on Streakk Chain - Blockchain
 
Blockchain Chapter #4.pdf
Blockchain Chapter #4.pdfBlockchain Chapter #4.pdf
Blockchain Chapter #4.pdf
 
Ethereum Solidity Fundamentals
Ethereum Solidity FundamentalsEthereum Solidity Fundamentals
Ethereum Solidity Fundamentals
 
Blockchain
BlockchainBlockchain
Blockchain
 
Multi-Signature Crypto-Wallets: Nakov at Blockchain Berlin 2018
Multi-Signature Crypto-Wallets: Nakov at Blockchain Berlin 2018Multi-Signature Crypto-Wallets: Nakov at Blockchain Berlin 2018
Multi-Signature Crypto-Wallets: Nakov at Blockchain Berlin 2018
 
Blockchain for Developers
Blockchain for DevelopersBlockchain for Developers
Blockchain for Developers
 
Understanding blockchain
Understanding blockchainUnderstanding blockchain
Understanding blockchain
 
EthereumBlockchainMarch3 (1).pptx
EthereumBlockchainMarch3 (1).pptxEthereumBlockchainMarch3 (1).pptx
EthereumBlockchainMarch3 (1).pptx
 
Ethereum Block Chain
Ethereum Block ChainEthereum Block Chain
Ethereum Block Chain
 
bitcoin_presentation
bitcoin_presentationbitcoin_presentation
bitcoin_presentation
 
BlockChain Public
BlockChain PublicBlockChain Public
BlockChain Public
 
Bitcoin
BitcoinBitcoin
Bitcoin
 
Explain Ethereum smart contract hacking like i am a five
Explain Ethereum smart contract hacking like i am a fiveExplain Ethereum smart contract hacking like i am a five
Explain Ethereum smart contract hacking like i am a five
 
Zoltán Balázs - Ethereum Smart Contract Hacking Explained like I’m Five
Zoltán Balázs - Ethereum Smart Contract Hacking Explained like I’m FiveZoltán Balázs - Ethereum Smart Contract Hacking Explained like I’m Five
Zoltán Balázs - Ethereum Smart Contract Hacking Explained like I’m Five
 
Building a NFT Marketplace DApp
Building a NFT Marketplace DAppBuilding a NFT Marketplace DApp
Building a NFT Marketplace DApp
 
Building Java and Android apps on the blockchain
Building Java and Android apps on the blockchain Building Java and Android apps on the blockchain
Building Java and Android apps on the blockchain
 

More from Tomoaki Sato

DAO, Starbase - 4th Blockchain research lab at Digital Hollywood University
DAO, Starbase - 4th Blockchain research lab at Digital Hollywood UniversityDAO, Starbase - 4th Blockchain research lab at Digital Hollywood University
DAO, Starbase - 4th Blockchain research lab at Digital Hollywood University
Tomoaki Sato
 
Restribute ~ Wealth re-distirbution by blockchain hardfork ~
Restribute ~ Wealth re-distirbution by blockchain hardfork ~ Restribute ~ Wealth re-distirbution by blockchain hardfork ~
Restribute ~ Wealth re-distirbution by blockchain hardfork ~
Tomoaki Sato
 
デジタルハリウッド大学院 ブロックチェーン研究会第三回 2016年8月25日
デジタルハリウッド大学院 ブロックチェーン研究会第三回 2016年8月25日デジタルハリウッド大学院 ブロックチェーン研究会第三回 2016年8月25日
デジタルハリウッド大学院 ブロックチェーン研究会第三回 2016年8月25日
Tomoaki Sato
 
約束としてのスマートコントラクト (Smart contract as a way of promise) 
約束としてのスマートコントラクト (Smart contract as a way of promise) 約束としてのスマートコントラクト (Smart contract as a way of promise) 
約束としてのスマートコントラクト (Smart contract as a way of promise) 
Tomoaki Sato
 
Localfacts smartcontractjp
Localfacts smartcontractjpLocalfacts smartcontractjp
Localfacts smartcontractjp
Tomoaki Sato
 
State Of Smart Contract Platforms from Smart Contract JP
State Of Smart Contract Platforms from Smart Contract JP State Of Smart Contract Platforms from Smart Contract JP
State Of Smart Contract Platforms from Smart Contract JP
Tomoaki Sato
 
Smart Contractjp 1st section about
Smart Contractjp 1st section aboutSmart Contractjp 1st section about
Smart Contractjp 1st section about
Tomoaki Sato
 

More from Tomoaki Sato (7)

DAO, Starbase - 4th Blockchain research lab at Digital Hollywood University
DAO, Starbase - 4th Blockchain research lab at Digital Hollywood UniversityDAO, Starbase - 4th Blockchain research lab at Digital Hollywood University
DAO, Starbase - 4th Blockchain research lab at Digital Hollywood University
 
Restribute ~ Wealth re-distirbution by blockchain hardfork ~
Restribute ~ Wealth re-distirbution by blockchain hardfork ~ Restribute ~ Wealth re-distirbution by blockchain hardfork ~
Restribute ~ Wealth re-distirbution by blockchain hardfork ~
 
デジタルハリウッド大学院 ブロックチェーン研究会第三回 2016年8月25日
デジタルハリウッド大学院 ブロックチェーン研究会第三回 2016年8月25日デジタルハリウッド大学院 ブロックチェーン研究会第三回 2016年8月25日
デジタルハリウッド大学院 ブロックチェーン研究会第三回 2016年8月25日
 
約束としてのスマートコントラクト (Smart contract as a way of promise) 
約束としてのスマートコントラクト (Smart contract as a way of promise) 約束としてのスマートコントラクト (Smart contract as a way of promise) 
約束としてのスマートコントラクト (Smart contract as a way of promise) 
 
Localfacts smartcontractjp
Localfacts smartcontractjpLocalfacts smartcontractjp
Localfacts smartcontractjp
 
State Of Smart Contract Platforms from Smart Contract JP
State Of Smart Contract Platforms from Smart Contract JP State Of Smart Contract Platforms from Smart Contract JP
State Of Smart Contract Platforms from Smart Contract JP
 
Smart Contractjp 1st section about
Smart Contractjp 1st section aboutSmart Contractjp 1st section about
Smart Contractjp 1st section about
 

Recently uploaded

Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
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
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
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
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 

Recently uploaded (20)

Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
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
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
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
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 

Dappsmedia smartcontract _write_smartcontracts_on_console_ethereum

  • 1. Smart contracts on Ethereum Getting started DappsMedia Tomoaki Sato June 2015 Main source: https://github.com/ethereum/wiki/wiki/Ethereum-Development-Tutorial ~From blockchain installation to make tokenContract ~
  • 2. What are smart contracts on Ethereum blockchain? 1Source: https://github.com/ethereum/wiki/wiki/White-Paper Original idea derived from Nick Szabo’s paper in1997. http://szabo.best.vwh.net/smart_contracts_idea.html and going to be live by Stateful blockchain with Ethereum virtual machine
  • 3. What kind of application needs smart contracts ? 2Source: Source 1.Vending machine 2.Asset automated transfer system • Token Systems • Financial derivatives • Identity and Reputation Systems • Decentralized File Storage • Decentralized Autonomous Organizations • See also https://docs.google.com/spreads heets/u/1/d/1VdRMFENPzjL2V- vZhcc_aa5- ysf243t5vXlxC2b054g/edit After blockchain age
  • 4. Smart contract 4 purposes 3 Smart contract 1. Maintain a data store contract. 2. Forwarding contract which has access policy, and some conditions to send messages. 3. Ongoing contract such as escrow, crowdfunding. 4.Library type contract which provides functions to other contracts. Process objectives Ethereum contracts objectives Source: https://github.com/ethereum/wiki/wiki/Ethereum-Development-Tutorial
  • 5. 1.Maintain a data store contract 4 Most simple type can be used by Embark (more about the later) Source: http://jorisbontje.github.io/sleth/#/ # app/contracts/simple_storage.sol contract SimpleStorage { uint storedData; function set(uint x) { storedData = x * x * x; } function get() constant returns (uint retVal) { return storedData; } }
  • 6. 2.Forwarding contract 5 Sleth is the decentralized slot machine application using forwarding type smart contract. Currently I can not find the forwarding type contract which can be run on testnet. If you know please comment on. Source: https://github.com/ethereum/wiki/wiki/Ethereum-Development-Tutorial When Bob wants to finalize the bet, the following steps happen: 1. A transaction is sent, triggering a message from Bob's EOA to Bob's forwarding contract. 2. Bob's forwarding contract sends the hash of the message and the Lamport signature to a contract which functions as a Lamport signature verification library. 3. The Lamport signature verification library sees that Bob wants a SHA256-based Lamport sig, so it calls the SHA256 library many times as needed to verify the signature. 4. Once the Lamport signature verification library returns 1, signifying that the signature has been verified, it sends a message to the contract representing the bet. 5. The bet contract checks the contract providing the San Francisco temperature to see what the temperature is.
  • 7. 3.Ongoing contract 6Source: https://github.com/WeiFund/WeiFund/blob/master/WeiFund.sol Most smart contracts are ongoing type contracts, such as crowdfunding is ongoing contract. // WeiFund System // Start, donate, payout and refund crowdfunding campaigns // @authors: // Nick Dodson <thenickdodson@gmail.com> // If goal is not reached and campaign is expired, contributers can get the refunded individually // If goal is reached by alloted time, contributions can still be made contract WeiFundConfig { function onContribute(uint cid, address addr, uint amount){} function onRefund(uint cid, address addr, uint amount){} function onPayout(uint cid, uint amount){} } contract WeiFund { struct User { uint numCampaigns; mapping(uint => uint) campaigns; } struct Funder { address addr; uint amount; } ...
  • 8. 4. Library contract 7Source: https://github.com/ethereum/wiki/wiki/Ethereum-Development-Tutorial Smart contract which provides utility functions. In the case below, Lamport sig verifier contract is Library type contracts. The contract will provide a set of function
  • 9. Structuring every type of smart contract 8 You can make structure by combining different contracts Source:https://github.com/ethereum/wiki/wiki/Ethereum-Development-Tutorial
  • 11. Our goal today 10 Download blockchain, writing smart contracts, publish contract on blockchain, send message to contracts. Source: http://jorisbontje.github.io/sleth/#/ http://ethereum.gitbooks.io/frontier-guide/content/contract_coin.html http://meteor-dapp-cosmo.meteor.com/ Cool! 1. Install Ethereum blockchain 2.writing smart contract 3.Publish contract on blockchain 4.Send message to contracts & check the result tokenInstance.getBalance.call(eth.accounts[1]) tokenInstance.sendToken.sendTransaction(et h.accounts[1], 100, {from: eth.accounts[0]})
  • 12. 1. Install Ethereum blockchain 11 3 ways to install... Source: http://jorisbontje.github.io/sleth/#/ 1. Live Testnet chain https://stats.ethdev.com/ 2. Private chain 3. Private chain with framework (Embark framework) https://github.com/iurimatias/embark-framework Cool!
  • 13. 1. Install Ethereum blockchain 12Source: http://jorisbontje.github.io/sleth/#/ 1. Live Testnet chain we will install this chain. https://stats.ethdev.com/ Cool! CPP O △ ☓
  • 14. 1. Install Ethereum blockchain 13Source: 1.Live Testnet chain we will install this chain. https://stats.ethdev.com/ June, 2015 Go-Ethereum = Geth ! 1. installation of geth https://github.com/ethereum/go-ethereum/releases/tag/v0.9.20 2. geth account new http://ethereum.gitbooks.io/frontier-guide/content/creating_accounts.html 3. Do mining & should wait until the Blocknumber on stats (roughly 4 ~6 hours ) https://stats.ethdev.com/
  • 15. 1. Install Ethereum blockchain 14 2.Private chain is private blockchain just for you. No network, your own blockchain. Source:https://github.com/ethereum/go-ethereum/wiki/Setting-up-private-network-or-local-cluster Currently Ethereum using blockchain, You can run multiple chains locally to do this, 1. Each instance has separate data dir 2. Each instance runs on a different port ( both eth and rpc. ) 3. The instances know about each other You can run multiple chains locally 1st chain // create dir for blockchain $ mkdir /tmp/eth/60/01 // run private chain $ geth –datadir=“/tmp/eth/60/01” – verbosity 6 –port 30301 –rpcport 8101 console 2>> /tmp/eth/60/01.log // mining start $ admin.miner.start() You can run multiple chains locally 2nd chain but for my env doesn’t work. // create dir for blockchain $ mkdir /tmp/eth/61/01 // run private chain $ geth –datadir=“/tmp/eth/61/01” – verbosity 6 –port 30302 –rpcport 8102 console 2>> /tmp/eth/61/01.log // mining start $ admin.miner.start()
  • 16. 1. Install Ethereum blockchain 15 3. Embark Framework for Ethereum DApps. https://iurimatias.github.io/embark-framework/ Source: https://iurimatias.github.io/embark-framework/ I feel 1. Easy to upload contracts you write to private blockchain 2. If you don’t know about How to use 3. Fast demo – Simple storage application using private chain is buildin demo. $ npm install -g embark-framework grunt-cli $ embark demo $ cd embark_demo $ embark blockchain $ embark run
  • 17. 2. Write smart contract after $ geth console 16 1. Write Token contract you can publish your own token. After $ geth console ### coin contract from console var tokenSource = 'contract token { mapping (address => uint) balances; function token() { balances[msg.sender] = 10000; } function sendToken(address receiver, uint amount) returns(bool sufficient) { if (balances[msg.sender] < amount) return false; balances[msg.sender] -= amount; balances[receiver] += amount; return true; } function getBalance(address account) returns(uint balance){ return balances[account]; } }' var tokenCompiled = eth.compile.solidity(tokenSource).token var tokenAddress = eth.sendTransaction({data: tokenCompiled.code, from: eth.accounts[0], gas:1000000}); admin.miner.start() admin.miner.stop() eth.getCode(tokenAddress) tokenContract = eth.contract(tokenCompiled.info.abiDefinition) tokenInstance = tokenContract.at(tokenAddress); > tokenInstance { address: '0xf95ff51f532bd6821b98f312e876e1e2213f3e36', sendToken: [Function], getBalance: [Function] } tokenInstance.getBalance.call(eth.accounts[0]) tokenInstance.sendToken.sendTransaction(eth.accounts[1], 100, {from: eth.accounts[0]}) admin.miner.start() admin.miner.stop() tokenInstance.getBalance.call(eth.accounts[0]) > tokenInstance.getBalance.call(eth.accounts[0]) '9900'
  • 18. 3.Publish contract 17 This phrase is uploading the contract onto blockchain. ### coin contract from console var tokenSource = 'contract token { mapping (address => uint) balances; function token() { balances[msg.sender] = 10000; } function sendToken(address receiver, uint amount) returns(bool sufficient) { if (balances[msg.sender] < amount) return false; balances[msg.sender] -= amount; balances[receiver] += amount; return true; } function getBalance(address account) returns(uint balance){ return balances[account]; } }' var tokenCompiled = eth.compile.solidity(tokenSource).token var tokenAddress = eth.sendTransaction({data: tokenCompiled.code, from: eth.accounts[0], gas:1000000}); admin.miner.start() admin.miner.stop() eth.getCode(tokenAddress) tokenContract = eth.contract(tokenCompiled.info.abiDefinition) tokenInstance = tokenContract.at(tokenAddress); > tokenInstance { address: '0xf95ff51f532bd6821b98f312e876e1e2213f3e36', sendToken: [Function], getBalance: [Function] } tokenInstance.getBalance.call(eth.accounts[0]) tokenInstance.sendToken.sendTransaction(eth.accounts[1], 100, {from: eth.accounts[0]}) admin.miner.start() admin.miner.stop() tokenInstance.getBalance.call(eth.accounts[0]) > tokenInstance.getBalance.call(eth.accounts[0]) '9900'
  • 19. 4.Send message to the contract and check the result 18 This phrase is sending message to the contract on blockchain. ### coin contract from console var tokenSource = 'contract token { mapping (address => uint) balances; function token() { balances[msg.sender] = 10000; } function sendToken(address receiver, uint amount) returns(bool sufficient) { if (balances[msg.sender] < amount) return false; balances[msg.sender] -= amount; balances[receiver] += amount; return true; } function getBalance(address account) returns(uint balance){ return balances[account]; } }' var tokenCompiled = eth.compile.solidity(tokenSource).token var tokenAddress = eth.sendTransaction({data: tokenCompiled.code, from: eth.accounts[0], gas:1000000}); admin.miner.start() admin.miner.stop() eth.getCode(tokenAddress) tokenContract = eth.contract(tokenCompiled.info.abiDefinition) tokenInstance = tokenContract.at(tokenAddress); > tokenInstance { address: '0xf95ff51f532bd6821b98f312e876e1e2213f3e36', sendToken: [Function], getBalance: [Function] } tokenInstance.getBalance.call(eth.accounts[0]) tokenInstance.sendToken.sendTransaction(eth.accounts[1], 100, {from: eth.accounts[0]}) admin.miner.start() admin.miner.stop() tokenInstance.getBalance.call(eth.accounts[0]) > tokenInstance.getBalance.call(eth.accounts[0]) '9900'
  • 20. Miscellaneous 19 Ethereum frontier guide Solidty online compiler https://chriseth.github.io/cpp-ethereum/ Geth(go-ethereum) https://github.com/ethereum/go-ethereum/releases/tag/v0.9.20 State of the DApps spreadsheet https://docs.google.com/spreadsheets/d/1VdRMFENPzjL2V-vZhcc_aa5- ysf243t5vXlxC2b054g/edit#gid=0 Ethereum forum https://forum.ethereum.org/categories/services-and-decentralized-applications Solidity presentation https://www.youtube.com/watch?v=DIqGDNPO5YM http://ethereum.gitbooks.io/frontier-guide/content/creating_accounts.html
  • 21. 20 Decentralization is just beginning. We hope you start to be involved in! Do you have interested in the DAppsMedia also ? If you have, contract us from here!