SlideShare a Scribd company logo
BLOCKCHAIN AND SMART
CONTRACTS SESSION 3
Hands-on introduction for
Software Developers and
Architects
PLAN FOR TODAY
Solidity data structures
Deep dive into the tool chain
Test networks
Very Simple Coin
ERC20 Token
ERC223 Token
ERC721 Token
SOLIDITY DATA
STRUCTURES
• Basic
• Arrays
• Structs
• Mappings
BASIC VALUE TYPES
Data Type Example
uint<M> , M=1,2,4, …, 256
int<M>, uint, int
Unsigned/signed integer uint256 counter = 1;
address 160-bit (20byte) value that
does not allow any
arithmetic operations. It is
suitable for storing
addresses of contracts or
keypairs belonging to
external persons.
Address has property
“balance”
address owner =
msg.sender;
If (owner.balance>10) …
bool Same as uint8 but values are
0 or 1
Bool b = 0;
b=true;
fixed<M>x<N>
ufixed<M>x<N>
Signed fixed-point decimal
number of M bits
fixed128x19 f = 1.1;
ARRAYS
Data Type Example
bytes1…bytes32, byte Fixed-size byte arrays byte1 bt1= 1;
Byte2 bt2=1;
if (bt2[0]==0) …
bt2.length
byte[N]
uint[N]
bool[N]
…
Fixed-size arrays byte[10] b;
fixed5x19[10] f;
byte[] Dynamic array uint[] memory a = new
uint[](7);
bytes Tightly-packed byte array bytes memory b = new
bytes(123);
string Same as bytes but can not string s=“Hello!”;
STRUCTS
pragma solidity ^0.4.11;
contract CrowdFunding {
// Defines a new type with two fields.
struct Funder {
address addr;
uint amount;
}
….
uint numFunders = 0;
mapping (uint => Funder) funders;
funders[numFunders++] = Funder({addr: msg.sender, amount: msg.value});
….
}
MAPPINGS
pragma solidity ^0.4.11;
contract CrowdFunding {
// Defines a new type with two fields.
struct Funder {
address addr;
uint amount;
}
….
uint numFunders = 0;
mapping (uint => Funder) funders;
funders[numFunders++] =
Funder({addr: msg.sender, amount: msg.value});
….
}
mapping(_KeyType => _ValueType)
_KeyType:
any type except mapping, dyn array,
contruct, enum or struct
_ValueType:
any type, including mappings
TOOLS
What you need to interact
with blockchain?
Setting up tools
TOOLBOX FOR ETHERIUM
Geth (command line tool)
Mist, Parity, Metamask (UI)
Etherscan.io
TEST BLOCKCHAINS
Ropsten
Rinkeby
Kovan
INSTALL PARITY
• sudo apt-get install openssl
libssl-dev libudev-dev
• bash <(curl
https://get.parity.io -kL)
Parity
(ALTERNATIVELY) INSTALL AND START LOCAL
TEST NETWORK
•$ npm install -g
ganache-cli
•$ ganache-cli &
Etherium
test
network
INSTALL NODE.JS
• sudo npm install npm@latest -gNODE.JS
INSTALL WEB3
• npm install web3
WEB3
INSTALL TRUFFLE FRAMEWORK
•$ sudo npm install -g truffle
•$ mkdir solidity-experiments
•$ cd solidity-experiments/
•$ truffle init
Truffle
Framework
INSTALL ZEPPELIN SOLIDITY
• sudo npm init -y
• sudo npm install -E
zeppelin-solidity
Zeppelin
Solidity
KOVAN TEST NETWORK
Connect to the network
Create account
Get some test Ether
KOVAN TESTNET
Kovan is a Proof of Authority publicly accessible blockchain for
Ethereum; created and maintained by a consortium of Ethereum
developers, to aide the Ethereum developer community.
Connect Get KETH Develop
START PARITY AND CONNECT TO
KOVAN
•sudo parity --chain
kovan ui
Etherium
with
Kovan
CREATE ACCOUNT ON KOVAN
NETWORK
parity account new --chain kovan
[Remember password and account id]
[Store password in a file for later use]
CONFIGURE TRUFFLE
• module.exports = {
• networks: {
• development: {
• host: "localhost",
• port: 8545,
• network_id: "*", // Match any
network id
• from: “<your account id>",
• gas: 4700000 // Gas limit}
• }
• };
Update
truffle.js
GET SOME ETHER (STEP 1, ASK)
Icarus Faucet (Automated after SMS
Verification)
https://youtu.be/99UucFzYCRc OR
Gitter Channel
https://gitter.im/kovan-testnet/faucet OR
Ask Gene – add comment with your account id
to the message board on
https://www.meetup.com/Blockchain-
Applications-and-Smart-
Contracts/events/tzwnjpyxfbmc/
GET SOME ETHER (STEP 2, SYNC
WITH NETWORK)
sudo parity --chain kovan
GET SOME ETHER (STEP 3, CHECK
YOUR BALANCE)
sudo geth attach
<path>/io.parity.ethereum/jsonrpc.ipc
account list
>
web3.fromWei(eth.getBalance(eth.coinbas
e), "ether")
50
SENDING ETHER
sudo geth attach
<path>/io.parity.ethereum/jsonrpc.ipc
account list
> eth.sendTransaction({from:sender,
to:receiver, value: amount})
>personal.unlockAccount(eth.coinbase)
>
eth.sendTransaction({from:eth.coinbase,
to:'0x00aA214a9Ecf3B4b7C3e70F8e7AB
CD39A71308E5', value: web3.toWei(1,
CREATE YOUR ERC20 COIN Code time
ERC20 TOKEN
Functions
totalSupply()
balanceOf(address tokenOwner)
allowance(address tokenOwner, address spender)
transfer(address to, uint tokens)
approve(address spender, uint tokens)
transferFrom(address from, address to, uint tokens)
Events
Transfer(address indexed from, address indexed to,
uint tokens);
Approval(address indexed tokenOwner, address
indexed spender, uint tokens);
CREATE ERC20 COIN CONTRACT
(SOLIDITY CODE)pragma solidity ^0.4.4;
import "../node_modules/zeppelin-solidity/contracts/token/StandardToken.sol";
/**
* @title RespectCoin
* @dev ERC20 Token example, where all tokens are pre-assigned to th
e creator.
* Note they can later distribute these tokens as they wish using `transfer` and
other
* `StandardToken` functions.
*/
contract RespectCoin is StandardToken {
string public constant name = "RespectCoin";
string public constant symbol = "RESPECT";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 10000 * (10 ** uint256(decimals));
/**
* @dev Constructor gives msg.sender all tokens
*/
function RespectCoin() public {
totalSupply = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
}
}
CREATE DEPLOYMENT SCRIPT
var Respect =
artifacts.require("./RespectCoin.sol"
);
module.exports =
function(deployer) {
deployer.deploy(Respect);
};
DEPLOY CONTRACT TO THE TEST
NETWORK
$ truffle console
truffle(development)> truffle migrate --reset
Using network 'development'.
Running migration: 1_initial_migration.js
Deploying Migrations...
... 0xb6bbeaaf3649ecb38d548cba96f681682dad9e0225726924fbee3ce36eff94e3
Migrations: 0xc08c46796ba0edc0bebbbd0d90868c010055cb0e
Saving successful migration to network...
... 0x16fe364b9f2c3e8f07fa1ebd6b84b8ad9b4e750d8698a7e920d824ebd019dd80
Saving artifacts...
Running migration: 2_deploy_contracts.js
Deploying Hello...
... 0xfe120836b2d7395bd988104feff018fe352f93555f71003bbf1a64671cca9ba1
Hello: 0x2b649a87d20ce1ac3b6a0218e911165fa0f095f0
Saving successful migration to network...
... 0x1a09073a3b3f7996f3d63a81a99d8cd09198ad7b467f35f7ddc500a4291332b9
Saving artifacts...
truffle(development)>
truffle(development)> truffle migrate --reset
CHECK RESPECT BALANCE
truffle(development)> var RespectCoin =
RespectCoin.at(RespectCoin.address)
undefined
truffle(development)>
RespectCoin.balanceOf(web3.eth.accounts[0]).then(result =>
result.toString())
'1e+22'
truffle(development)>
LOOK AT RAW COMPILED CODE
truffle(development)>
web3.eth.getCode('0x228911363fa3ff0c99d98e8cdfa20aa4e
0c1db0a')'0x6060604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014d57806318160ddd146101a757806323b872dd146101d05780632ff2e9dc14610249578063313ce56
71461027257806366188463146102a157806370a08231146102fb57806395d89b4114610348578063a9059cbb146103d6578063d73dd62314610430578063dd62ed3e1461048a575b600080fd5b34156100ca57600080fd5b6100d26104f6565b6040518080602001828103825283818151
815260200191508051906020019080838360005b838110156101125780820151818401526020810190506100f7565b50505050905090810190601f16801561013f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015857600
080fd5b61018d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061052f565b604051808215151515815260200191505060405180910390f35b34156101b257600080fd5b6101ba610621565b6040518082815260200191505060405180910390
f35b34156101db57600080fd5b61022f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610627565b604051808215151515815260200191505060405180910390f35b3415610254576
00080fd5b61025c6109e6565b6040518082815260200191505060405180910390f35b341561027d57600080fd5b6102856109f5565b604051808260ff1660ff16815260200191505060405180910390f35b34156102ac57600080fd5b6102e1600480803573ffffffffffffffffffffffffffffffffffffffff169
060200190919080359060200190919050506109fa565b604051808215151515815260200191505060405180910390f35b341561030657600080fd5b610332600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c8b565b604051808281526020019150506040518091
0390f35b341561035357600080fd5b61035b610cd4565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561039b578082015181840152602081019050610380565b50505050905090810190601f1680156103c857808203805160018
36020036101000a031916815260200191505b509250505060405180910390f35b34156103e157600080fd5b610416600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d0d565b604051808215151515815260200191505060405180910390f3
5b341561043b57600080fd5b610470600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f31565b604051808215151515815260200191505060405180910390f35b341561049557600080fd5b6104e0600480803573fffffffffffffffffffffffffffffffffff
fffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061112d565b6040518082815260200191505060405180910390f35b6040805190810160405280600b81526020017f52657370656374436f696e00000000000000000000000000000000000000000081
525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273fffffffffffffffffffff
fffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b60008073ffffffffffffffffffffffffffffffffffffffff168373fffffff
fffffffffffffffffffffffffffffffff161415151561066457600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156106b257600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673fffffffffffffffffffffff
fffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561073d57600080fd5b61078f82600160008773ffffffffffffffffffffffffffffffffffffffff1673fffffffffffffffffffffffffffff
fffffffffff168152602001908152602001600020546111b490919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061082482600160008673ffffffffffffffffffffffffffffffffffffffff1673fffffffffffffffffff
fffffffffffffffffffff168152602001908152602001600020546111cd90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108f682600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffff
ffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111b490919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673fffffffffffffffffffffffffffffffff
fffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa
952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601260ff16600a0a6127100281565b601281565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260
200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610b0b576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008
673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b9f565b610b1e83826111b490919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200
160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7
c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808281526020019150506040518
0910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6040805190810160405280600781526020017f5245535045435400000000000000000000000000000
00000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610d4a57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115
1515610d9857600080fd5b610dea82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111b490919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020
0190815260200160002081905550610e7f82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111cd90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681
52602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006
10fc282600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111cd90919063ffffffff16565b60026000
3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373fffffffffff
fffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673fffffffffffffffffff
fffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373fffffffffffffffffffff
fffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008282111515156111c257fe5b818303905092915050565b60008082840190508381101515156111e157fe5b80915050929150505600a165627a7a7230582025cadb1eada
4c612f0c8de847d597805ac8390d9d469e54a763a3ae1823274810029'
TOKENS
• ERC20
• ERC223
• ERC721
ERC223 TOKEN
ERC223 is backwards compatible with ERC20
merges the token transfer function among wallets and contracts into
one single function ‘transfer()’
does not allow token to be transferred to a contract that does not
allow token to be withdrawn
ERC223 TOKEN INTERFACE
contract ERC223 {
uint public totalSupply;
function balanceOf(address who) public view returns
(uint);
function name() public view returns (string _name);
function symbol() public view returns (string _symbol);
function decimals() public view returns (uint8 _decimals);
function totalSupply() public view returns (uint256
_supply);
function transfer(address to, uint value) public returns
(bool ok);
function transfer(address to, uint value, bytes data) public
returns (bool ok);
function transfer(address to, uint value, bytes data, string
custom_fallback) public returns (bool ok);
event Transfer(address indexed from, address indexed to,
uint value, bytes indexed data);
ERC721
People love collecting
Allow smart contracts to operate as tradable tokens
Each ERC721 is unique (non-fungible)
Support “ownership” functions
Each token is referenced by unique id
Tokens can have metadata (attributes)
ERC721
contract ERC721 {
event Transfer(address indexed _from, address
indexed _to, uint256 _tokenId);
event Approval(address indexed _owner, address
indexed _approved, uint256 _tokenId);
function balanceOf(address _owner) public view
returns (uint256 _balance);
function ownerOf(uint256 _tokenId) public view
returns (address _owner);
function transfer(address _to, uint256 _tokenId)
public;
function approve(address _to, uint256 _tokenId)
public;
STAY IN TOUCH
Gene Leybzon https://www.linkedin.com/in/leybzon/
https://www.meetup.com/members/90744
20/
https://www.leybzon.com

More Related Content

What's hot

Blockchain Coding Dojo - BlockchainHub Graz
Blockchain Coding Dojo - BlockchainHub GrazBlockchain Coding Dojo - BlockchainHub Graz
Blockchain Coding Dojo - BlockchainHub Graz
BlockchainHub Graz
 
Solidity Simple Tutorial EN
Solidity Simple Tutorial ENSolidity Simple Tutorial EN
Solidity Simple Tutorial EN
Nicholas Lin
 
Learning Solidity
Learning SolidityLearning Solidity
Learning Solidity
Arnold Pham
 
Ripple
RippleRipple
Ripple
Gene Leybzon
 
Solidity Security and Best Coding Practices
Solidity Security and Best Coding PracticesSolidity Security and Best Coding Practices
Solidity Security and Best Coding Practices
Gene Leybzon
 
Ethereum Contracts - Coinfest 2015
Ethereum Contracts - Coinfest 2015Ethereum Contracts - Coinfest 2015
Ethereum Contracts - Coinfest 2015
Rhea Myers
 
Solidity
SoliditySolidity
Solidity
gavofyork
 
Smart contract and Solidity
Smart contract and SoliditySmart contract and Solidity
Smart contract and Solidity
겨울 정
 
The Ethereum Geth Client
The Ethereum Geth ClientThe Ethereum Geth Client
The Ethereum Geth Client
Arnold Pham
 
Smart contracts in Solidity
Smart contracts in SoliditySmart contracts in Solidity
Smart contracts in Solidity
Felix Crisan
 
Cyber Security
Cyber SecurityCyber Security
Cyber Security
amit bezalel
 
How to be a smart contract engineer
How to be a smart contract engineerHow to be a smart contract engineer
How to be a smart contract engineer
Oded Noam
 
ERC20 Token Contract
ERC20 Token ContractERC20 Token Contract
ERC20 Token Contract
KC Tam
 
Creating an Arduino Web Server from scratch hardware and software
Creating an Arduino Web Server from scratch hardware and softwareCreating an Arduino Web Server from scratch hardware and software
Creating an Arduino Web Server from scratch hardware and software
Justin Mclean
 
Tuga IT 2017 - Redis
Tuga IT 2017 - RedisTuga IT 2017 - Redis
Tuga IT 2017 - Redis
Nuno Caneco
 
Hands on with smart contracts
Hands on with smart contractsHands on with smart contracts
Hands on with smart contracts
Gene Leybzon
 
Introduction solidity
Introduction solidityIntroduction solidity
Introduction solidity
Nicolas Wagner
 
“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
EIT Digital Alumni
 
BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session
BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session
BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session
병완 임
 
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
Zvi Avraham
 

What's hot (20)

Blockchain Coding Dojo - BlockchainHub Graz
Blockchain Coding Dojo - BlockchainHub GrazBlockchain Coding Dojo - BlockchainHub Graz
Blockchain Coding Dojo - BlockchainHub Graz
 
Solidity Simple Tutorial EN
Solidity Simple Tutorial ENSolidity Simple Tutorial EN
Solidity Simple Tutorial EN
 
Learning Solidity
Learning SolidityLearning Solidity
Learning Solidity
 
Ripple
RippleRipple
Ripple
 
Solidity Security and Best Coding Practices
Solidity Security and Best Coding PracticesSolidity Security and Best Coding Practices
Solidity Security and Best Coding Practices
 
Ethereum Contracts - Coinfest 2015
Ethereum Contracts - Coinfest 2015Ethereum Contracts - Coinfest 2015
Ethereum Contracts - Coinfest 2015
 
Solidity
SoliditySolidity
Solidity
 
Smart contract and Solidity
Smart contract and SoliditySmart contract and Solidity
Smart contract and Solidity
 
The Ethereum Geth Client
The Ethereum Geth ClientThe Ethereum Geth Client
The Ethereum Geth Client
 
Smart contracts in Solidity
Smart contracts in SoliditySmart contracts in Solidity
Smart contracts in Solidity
 
Cyber Security
Cyber SecurityCyber Security
Cyber Security
 
How to be a smart contract engineer
How to be a smart contract engineerHow to be a smart contract engineer
How to be a smart contract engineer
 
ERC20 Token Contract
ERC20 Token ContractERC20 Token Contract
ERC20 Token Contract
 
Creating an Arduino Web Server from scratch hardware and software
Creating an Arduino Web Server from scratch hardware and softwareCreating an Arduino Web Server from scratch hardware and software
Creating an Arduino Web Server from scratch hardware and software
 
Tuga IT 2017 - Redis
Tuga IT 2017 - RedisTuga IT 2017 - Redis
Tuga IT 2017 - Redis
 
Hands on with smart contracts
Hands on with smart contractsHands on with smart contracts
Hands on with smart contracts
 
Introduction solidity
Introduction solidityIntroduction solidity
Introduction solidity
 
“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
 
BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session
BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session
BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session
 
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
 

Similar to Hands on with Smart Contracts session #3

Blockchain
BlockchainBlockchain
Blockchain
Rishabh Sharma
 
Red Hat Forum Tokyo - OpenStack Architecture
Red Hat Forum Tokyo - OpenStack ArchitectureRed Hat Forum Tokyo - OpenStack Architecture
Red Hat Forum Tokyo - OpenStack Architecture
Dan Radez
 
Getting started with RDO Havana
Getting started with RDO HavanaGetting started with RDO Havana
Getting started with RDO Havana
Dan Radez
 
Harmonia open iris_basic_v0.1
Harmonia open iris_basic_v0.1Harmonia open iris_basic_v0.1
Harmonia open iris_basic_v0.1
Yongyoon Shin
 
A Decompiler for Blackhain-Based Smart Contracts Bytecode
A Decompiler for Blackhain-Based Smart Contracts BytecodeA Decompiler for Blackhain-Based Smart Contracts Bytecode
A Decompiler for Blackhain-Based Smart Contracts Bytecode
Shakacon
 
Runtime Bytecode Transformation for Smalltalk
Runtime Bytecode Transformation for SmalltalkRuntime Bytecode Transformation for Smalltalk
Runtime Bytecode Transformation for Smalltalk
ESUG
 
Managing Large-scale Networks with Trigger
Managing Large-scale Networks with TriggerManaging Large-scale Networks with Trigger
Managing Large-scale Networks with Trigger
jathanism
 
ImplementingCryptoSecurityARMCortex_Doin
ImplementingCryptoSecurityARMCortex_DoinImplementingCryptoSecurityARMCortex_Doin
ImplementingCryptoSecurityARMCortex_Doin
Jonny Doin
 
Ft10 de smet
Ft10 de smetFt10 de smet
Ft10 de smet
nkaluva
 
Solr @ Etsy - Apache Lucene Eurocon
Solr @ Etsy - Apache Lucene EuroconSolr @ Etsy - Apache Lucene Eurocon
Solr @ Etsy - Apache Lucene Eurocon
Giovanni Fernandez-Kincade
 
Scaling Ethereum using Zero-Knowledge Proofs
Scaling Ethereum using Zero-Knowledge ProofsScaling Ethereum using Zero-Knowledge Proofs
Scaling Ethereum using Zero-Knowledge Proofs
Hyojun Kim
 
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...
Athens IoT Meetup
 
Ice mini guide
Ice mini guideIce mini guide
Ice mini guide
Ady Liu
 
Runtime Bytecode Transformation for Smalltalk
Runtime Bytecode Transformation for SmalltalkRuntime Bytecode Transformation for Smalltalk
Runtime Bytecode Transformation for Smalltalk
Marcus Denker
 
Netmiko library
Netmiko libraryNetmiko library
Netmiko library
Manjunath annure
 
Fosdem10
Fosdem10Fosdem10
Fosdem10
wremes
 
Georgy Nosenko - An introduction to the use SMT solvers for software security
Georgy Nosenko - An introduction to the use SMT solvers for software securityGeorgy Nosenko - An introduction to the use SMT solvers for software security
Georgy Nosenko - An introduction to the use SMT solvers for software security
DefconRussia
 
Security in the blockchain
Security in the blockchainSecurity in the blockchain
Security in the blockchain
Bellaj Badr
 
Lecture. Advanced Reflection: MetaLinks
Lecture. Advanced Reflection: MetaLinksLecture. Advanced Reflection: MetaLinks
Lecture. Advanced Reflection: MetaLinks
Marcus Denker
 
Blockchain, cryptography and tokens — NYC Bar presentation
Blockchain, cryptography and tokens — NYC Bar presentationBlockchain, cryptography and tokens — NYC Bar presentation
Blockchain, cryptography and tokens — NYC Bar presentation
Paperchain
 

Similar to Hands on with Smart Contracts session #3 (20)

Blockchain
BlockchainBlockchain
Blockchain
 
Red Hat Forum Tokyo - OpenStack Architecture
Red Hat Forum Tokyo - OpenStack ArchitectureRed Hat Forum Tokyo - OpenStack Architecture
Red Hat Forum Tokyo - OpenStack Architecture
 
Getting started with RDO Havana
Getting started with RDO HavanaGetting started with RDO Havana
Getting started with RDO Havana
 
Harmonia open iris_basic_v0.1
Harmonia open iris_basic_v0.1Harmonia open iris_basic_v0.1
Harmonia open iris_basic_v0.1
 
A Decompiler for Blackhain-Based Smart Contracts Bytecode
A Decompiler for Blackhain-Based Smart Contracts BytecodeA Decompiler for Blackhain-Based Smart Contracts Bytecode
A Decompiler for Blackhain-Based Smart Contracts Bytecode
 
Runtime Bytecode Transformation for Smalltalk
Runtime Bytecode Transformation for SmalltalkRuntime Bytecode Transformation for Smalltalk
Runtime Bytecode Transformation for Smalltalk
 
Managing Large-scale Networks with Trigger
Managing Large-scale Networks with TriggerManaging Large-scale Networks with Trigger
Managing Large-scale Networks with Trigger
 
ImplementingCryptoSecurityARMCortex_Doin
ImplementingCryptoSecurityARMCortex_DoinImplementingCryptoSecurityARMCortex_Doin
ImplementingCryptoSecurityARMCortex_Doin
 
Ft10 de smet
Ft10 de smetFt10 de smet
Ft10 de smet
 
Solr @ Etsy - Apache Lucene Eurocon
Solr @ Etsy - Apache Lucene EuroconSolr @ Etsy - Apache Lucene Eurocon
Solr @ Etsy - Apache Lucene Eurocon
 
Scaling Ethereum using Zero-Knowledge Proofs
Scaling Ethereum using Zero-Knowledge ProofsScaling Ethereum using Zero-Knowledge Proofs
Scaling Ethereum using Zero-Knowledge Proofs
 
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...
 
Ice mini guide
Ice mini guideIce mini guide
Ice mini guide
 
Runtime Bytecode Transformation for Smalltalk
Runtime Bytecode Transformation for SmalltalkRuntime Bytecode Transformation for Smalltalk
Runtime Bytecode Transformation for Smalltalk
 
Netmiko library
Netmiko libraryNetmiko library
Netmiko library
 
Fosdem10
Fosdem10Fosdem10
Fosdem10
 
Georgy Nosenko - An introduction to the use SMT solvers for software security
Georgy Nosenko - An introduction to the use SMT solvers for software securityGeorgy Nosenko - An introduction to the use SMT solvers for software security
Georgy Nosenko - An introduction to the use SMT solvers for software security
 
Security in the blockchain
Security in the blockchainSecurity in the blockchain
Security in the blockchain
 
Lecture. Advanced Reflection: MetaLinks
Lecture. Advanced Reflection: MetaLinksLecture. Advanced Reflection: MetaLinks
Lecture. Advanced Reflection: MetaLinks
 
Blockchain, cryptography and tokens — NYC Bar presentation
Blockchain, cryptography and tokens — NYC Bar presentationBlockchain, cryptography and tokens — NYC Bar presentation
Blockchain, cryptography and tokens — NYC Bar presentation
 

More from Gene Leybzon

Generative AI Application Development using LangChain and LangFlow
Generative AI Application Development using LangChain and LangFlowGenerative AI Application Development using LangChain and LangFlow
Generative AI Application Development using LangChain and LangFlow
Gene Leybzon
 
Chat GPTs
Chat GPTsChat GPTs
Chat GPTs
Gene Leybzon
 
Generative AI Use cases for Enterprise - Second Session
Generative AI Use cases for Enterprise - Second SessionGenerative AI Use cases for Enterprise - Second Session
Generative AI Use cases for Enterprise - Second Session
Gene Leybzon
 
Generative AI Use-cases for Enterprise - First Session
Generative AI Use-cases for Enterprise - First SessionGenerative AI Use-cases for Enterprise - First Session
Generative AI Use-cases for Enterprise - First Session
Gene Leybzon
 
Non-fungible tokens (nfts)
Non-fungible tokens (nfts)Non-fungible tokens (nfts)
Non-fungible tokens (nfts)
Gene Leybzon
 
Introduction to Solidity and Smart Contract Development (9).pptx
Introduction to Solidity and Smart Contract Development (9).pptxIntroduction to Solidity and Smart Contract Development (9).pptx
Introduction to Solidity and Smart Contract Development (9).pptx
Gene Leybzon
 
Ethereum in Enterprise.pptx
Ethereum in Enterprise.pptxEthereum in Enterprise.pptx
Ethereum in Enterprise.pptx
Gene Leybzon
 
ERC-4907 Rentable NFT Standard.pptx
ERC-4907 Rentable NFT Standard.pptxERC-4907 Rentable NFT Standard.pptx
ERC-4907 Rentable NFT Standard.pptx
Gene Leybzon
 
Onchain Decentralized Governance 2.pptx
Onchain Decentralized Governance 2.pptxOnchain Decentralized Governance 2.pptx
Onchain Decentralized Governance 2.pptx
Gene Leybzon
 
Onchain Decentralized Governance.pptx
Onchain Decentralized Governance.pptxOnchain Decentralized Governance.pptx
Onchain Decentralized Governance.pptx
Gene Leybzon
 
Web3 File Storage Options
Web3 File Storage OptionsWeb3 File Storage Options
Web3 File Storage Options
Gene Leybzon
 
Web3 Full Stack Development
Web3 Full Stack DevelopmentWeb3 Full Stack Development
Web3 Full Stack Development
Gene Leybzon
 
Instantly tradeable NFT contracts based on ERC-1155 standard
Instantly tradeable NFT contracts based on ERC-1155 standardInstantly tradeable NFT contracts based on ERC-1155 standard
Instantly tradeable NFT contracts based on ERC-1155 standard
Gene Leybzon
 
Non-fungible tokens. From smart contract code to marketplace
Non-fungible tokens. From smart contract code to marketplaceNon-fungible tokens. From smart contract code to marketplace
Non-fungible tokens. From smart contract code to marketplace
Gene Leybzon
 
The Art of non-fungible tokens
The Art of non-fungible tokensThe Art of non-fungible tokens
The Art of non-fungible tokens
Gene Leybzon
 
Graph protocol for accessing information about blockchains and d apps
Graph protocol for accessing information about blockchains and d appsGraph protocol for accessing information about blockchains and d apps
Graph protocol for accessing information about blockchains and d apps
Gene Leybzon
 
Substrate Framework
Substrate FrameworkSubstrate Framework
Substrate Framework
Gene Leybzon
 
Chainlink
ChainlinkChainlink
Chainlink
Gene Leybzon
 
Chainlink, Cosmos, Kusama, Polkadot: Approaches to the Internet of Blockchains
Chainlink, Cosmos, Kusama, Polkadot:   Approaches to the Internet of BlockchainsChainlink, Cosmos, Kusama, Polkadot:   Approaches to the Internet of Blockchains
Chainlink, Cosmos, Kusama, Polkadot: Approaches to the Internet of Blockchains
Gene Leybzon
 
Oracles
OraclesOracles
Oracles
Gene Leybzon
 

More from Gene Leybzon (20)

Generative AI Application Development using LangChain and LangFlow
Generative AI Application Development using LangChain and LangFlowGenerative AI Application Development using LangChain and LangFlow
Generative AI Application Development using LangChain and LangFlow
 
Chat GPTs
Chat GPTsChat GPTs
Chat GPTs
 
Generative AI Use cases for Enterprise - Second Session
Generative AI Use cases for Enterprise - Second SessionGenerative AI Use cases for Enterprise - Second Session
Generative AI Use cases for Enterprise - Second Session
 
Generative AI Use-cases for Enterprise - First Session
Generative AI Use-cases for Enterprise - First SessionGenerative AI Use-cases for Enterprise - First Session
Generative AI Use-cases for Enterprise - First Session
 
Non-fungible tokens (nfts)
Non-fungible tokens (nfts)Non-fungible tokens (nfts)
Non-fungible tokens (nfts)
 
Introduction to Solidity and Smart Contract Development (9).pptx
Introduction to Solidity and Smart Contract Development (9).pptxIntroduction to Solidity and Smart Contract Development (9).pptx
Introduction to Solidity and Smart Contract Development (9).pptx
 
Ethereum in Enterprise.pptx
Ethereum in Enterprise.pptxEthereum in Enterprise.pptx
Ethereum in Enterprise.pptx
 
ERC-4907 Rentable NFT Standard.pptx
ERC-4907 Rentable NFT Standard.pptxERC-4907 Rentable NFT Standard.pptx
ERC-4907 Rentable NFT Standard.pptx
 
Onchain Decentralized Governance 2.pptx
Onchain Decentralized Governance 2.pptxOnchain Decentralized Governance 2.pptx
Onchain Decentralized Governance 2.pptx
 
Onchain Decentralized Governance.pptx
Onchain Decentralized Governance.pptxOnchain Decentralized Governance.pptx
Onchain Decentralized Governance.pptx
 
Web3 File Storage Options
Web3 File Storage OptionsWeb3 File Storage Options
Web3 File Storage Options
 
Web3 Full Stack Development
Web3 Full Stack DevelopmentWeb3 Full Stack Development
Web3 Full Stack Development
 
Instantly tradeable NFT contracts based on ERC-1155 standard
Instantly tradeable NFT contracts based on ERC-1155 standardInstantly tradeable NFT contracts based on ERC-1155 standard
Instantly tradeable NFT contracts based on ERC-1155 standard
 
Non-fungible tokens. From smart contract code to marketplace
Non-fungible tokens. From smart contract code to marketplaceNon-fungible tokens. From smart contract code to marketplace
Non-fungible tokens. From smart contract code to marketplace
 
The Art of non-fungible tokens
The Art of non-fungible tokensThe Art of non-fungible tokens
The Art of non-fungible tokens
 
Graph protocol for accessing information about blockchains and d apps
Graph protocol for accessing information about blockchains and d appsGraph protocol for accessing information about blockchains and d apps
Graph protocol for accessing information about blockchains and d apps
 
Substrate Framework
Substrate FrameworkSubstrate Framework
Substrate Framework
 
Chainlink
ChainlinkChainlink
Chainlink
 
Chainlink, Cosmos, Kusama, Polkadot: Approaches to the Internet of Blockchains
Chainlink, Cosmos, Kusama, Polkadot:   Approaches to the Internet of BlockchainsChainlink, Cosmos, Kusama, Polkadot:   Approaches to the Internet of Blockchains
Chainlink, Cosmos, Kusama, Polkadot: Approaches to the Internet of Blockchains
 
Oracles
OraclesOracles
Oracles
 

Recently uploaded

Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
mz5nrf0n
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
TaghreedAltamimi
 
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative AnalysisOdoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Envertis Software Solutions
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
GohKiangHock
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
Yara Milbes
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
Peter Muessig
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 

Recently uploaded (20)

Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
 
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative AnalysisOdoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 

Hands on with Smart Contracts session #3

  • 1. BLOCKCHAIN AND SMART CONTRACTS SESSION 3 Hands-on introduction for Software Developers and Architects
  • 2. PLAN FOR TODAY Solidity data structures Deep dive into the tool chain Test networks Very Simple Coin ERC20 Token ERC223 Token ERC721 Token
  • 3. SOLIDITY DATA STRUCTURES • Basic • Arrays • Structs • Mappings
  • 4. BASIC VALUE TYPES Data Type Example uint<M> , M=1,2,4, …, 256 int<M>, uint, int Unsigned/signed integer uint256 counter = 1; address 160-bit (20byte) value that does not allow any arithmetic operations. It is suitable for storing addresses of contracts or keypairs belonging to external persons. Address has property “balance” address owner = msg.sender; If (owner.balance>10) … bool Same as uint8 but values are 0 or 1 Bool b = 0; b=true; fixed<M>x<N> ufixed<M>x<N> Signed fixed-point decimal number of M bits fixed128x19 f = 1.1;
  • 5. ARRAYS Data Type Example bytes1…bytes32, byte Fixed-size byte arrays byte1 bt1= 1; Byte2 bt2=1; if (bt2[0]==0) … bt2.length byte[N] uint[N] bool[N] … Fixed-size arrays byte[10] b; fixed5x19[10] f; byte[] Dynamic array uint[] memory a = new uint[](7); bytes Tightly-packed byte array bytes memory b = new bytes(123); string Same as bytes but can not string s=“Hello!”;
  • 6. STRUCTS pragma solidity ^0.4.11; contract CrowdFunding { // Defines a new type with two fields. struct Funder { address addr; uint amount; } …. uint numFunders = 0; mapping (uint => Funder) funders; funders[numFunders++] = Funder({addr: msg.sender, amount: msg.value}); …. }
  • 7. MAPPINGS pragma solidity ^0.4.11; contract CrowdFunding { // Defines a new type with two fields. struct Funder { address addr; uint amount; } …. uint numFunders = 0; mapping (uint => Funder) funders; funders[numFunders++] = Funder({addr: msg.sender, amount: msg.value}); …. } mapping(_KeyType => _ValueType) _KeyType: any type except mapping, dyn array, contruct, enum or struct _ValueType: any type, including mappings
  • 8. TOOLS What you need to interact with blockchain? Setting up tools
  • 9. TOOLBOX FOR ETHERIUM Geth (command line tool) Mist, Parity, Metamask (UI) Etherscan.io
  • 11. INSTALL PARITY • sudo apt-get install openssl libssl-dev libudev-dev • bash <(curl https://get.parity.io -kL) Parity
  • 12. (ALTERNATIVELY) INSTALL AND START LOCAL TEST NETWORK •$ npm install -g ganache-cli •$ ganache-cli & Etherium test network
  • 13. INSTALL NODE.JS • sudo npm install npm@latest -gNODE.JS
  • 14. INSTALL WEB3 • npm install web3 WEB3
  • 15. INSTALL TRUFFLE FRAMEWORK •$ sudo npm install -g truffle •$ mkdir solidity-experiments •$ cd solidity-experiments/ •$ truffle init Truffle Framework
  • 16. INSTALL ZEPPELIN SOLIDITY • sudo npm init -y • sudo npm install -E zeppelin-solidity Zeppelin Solidity
  • 17. KOVAN TEST NETWORK Connect to the network Create account Get some test Ether
  • 18. KOVAN TESTNET Kovan is a Proof of Authority publicly accessible blockchain for Ethereum; created and maintained by a consortium of Ethereum developers, to aide the Ethereum developer community. Connect Get KETH Develop
  • 19. START PARITY AND CONNECT TO KOVAN •sudo parity --chain kovan ui Etherium with Kovan
  • 20. CREATE ACCOUNT ON KOVAN NETWORK parity account new --chain kovan [Remember password and account id] [Store password in a file for later use]
  • 21. CONFIGURE TRUFFLE • module.exports = { • networks: { • development: { • host: "localhost", • port: 8545, • network_id: "*", // Match any network id • from: “<your account id>", • gas: 4700000 // Gas limit} • } • }; Update truffle.js
  • 22. GET SOME ETHER (STEP 1, ASK) Icarus Faucet (Automated after SMS Verification) https://youtu.be/99UucFzYCRc OR Gitter Channel https://gitter.im/kovan-testnet/faucet OR Ask Gene – add comment with your account id to the message board on https://www.meetup.com/Blockchain- Applications-and-Smart- Contracts/events/tzwnjpyxfbmc/
  • 23. GET SOME ETHER (STEP 2, SYNC WITH NETWORK) sudo parity --chain kovan
  • 24. GET SOME ETHER (STEP 3, CHECK YOUR BALANCE) sudo geth attach <path>/io.parity.ethereum/jsonrpc.ipc account list > web3.fromWei(eth.getBalance(eth.coinbas e), "ether") 50
  • 25. SENDING ETHER sudo geth attach <path>/io.parity.ethereum/jsonrpc.ipc account list > eth.sendTransaction({from:sender, to:receiver, value: amount}) >personal.unlockAccount(eth.coinbase) > eth.sendTransaction({from:eth.coinbase, to:'0x00aA214a9Ecf3B4b7C3e70F8e7AB CD39A71308E5', value: web3.toWei(1,
  • 26. CREATE YOUR ERC20 COIN Code time
  • 27. ERC20 TOKEN Functions totalSupply() balanceOf(address tokenOwner) allowance(address tokenOwner, address spender) transfer(address to, uint tokens) approve(address spender, uint tokens) transferFrom(address from, address to, uint tokens) Events Transfer(address indexed from, address indexed to, uint tokens); Approval(address indexed tokenOwner, address indexed spender, uint tokens);
  • 28. CREATE ERC20 COIN CONTRACT (SOLIDITY CODE)pragma solidity ^0.4.4; import "../node_modules/zeppelin-solidity/contracts/token/StandardToken.sol"; /** * @title RespectCoin * @dev ERC20 Token example, where all tokens are pre-assigned to th e creator. * Note they can later distribute these tokens as they wish using `transfer` and other * `StandardToken` functions. */ contract RespectCoin is StandardToken { string public constant name = "RespectCoin"; string public constant symbol = "RESPECT"; uint8 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 10000 * (10 ** uint256(decimals)); /** * @dev Constructor gives msg.sender all tokens */ function RespectCoin() public { totalSupply = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; } }
  • 29. CREATE DEPLOYMENT SCRIPT var Respect = artifacts.require("./RespectCoin.sol" ); module.exports = function(deployer) { deployer.deploy(Respect); };
  • 30. DEPLOY CONTRACT TO THE TEST NETWORK $ truffle console truffle(development)> truffle migrate --reset Using network 'development'. Running migration: 1_initial_migration.js Deploying Migrations... ... 0xb6bbeaaf3649ecb38d548cba96f681682dad9e0225726924fbee3ce36eff94e3 Migrations: 0xc08c46796ba0edc0bebbbd0d90868c010055cb0e Saving successful migration to network... ... 0x16fe364b9f2c3e8f07fa1ebd6b84b8ad9b4e750d8698a7e920d824ebd019dd80 Saving artifacts... Running migration: 2_deploy_contracts.js Deploying Hello... ... 0xfe120836b2d7395bd988104feff018fe352f93555f71003bbf1a64671cca9ba1 Hello: 0x2b649a87d20ce1ac3b6a0218e911165fa0f095f0 Saving successful migration to network... ... 0x1a09073a3b3f7996f3d63a81a99d8cd09198ad7b467f35f7ddc500a4291332b9 Saving artifacts... truffle(development)> truffle(development)> truffle migrate --reset
  • 31. CHECK RESPECT BALANCE truffle(development)> var RespectCoin = RespectCoin.at(RespectCoin.address) undefined truffle(development)> RespectCoin.balanceOf(web3.eth.accounts[0]).then(result => result.toString()) '1e+22' truffle(development)>
  • 32. LOOK AT RAW COMPILED CODE truffle(development)> web3.eth.getCode('0x228911363fa3ff0c99d98e8cdfa20aa4e 0c1db0a')'0x6060604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014d57806318160ddd146101a757806323b872dd146101d05780632ff2e9dc14610249578063313ce56 71461027257806366188463146102a157806370a08231146102fb57806395d89b4114610348578063a9059cbb146103d6578063d73dd62314610430578063dd62ed3e1461048a575b600080fd5b34156100ca57600080fd5b6100d26104f6565b6040518080602001828103825283818151 815260200191508051906020019080838360005b838110156101125780820151818401526020810190506100f7565b50505050905090810190601f16801561013f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015857600 080fd5b61018d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061052f565b604051808215151515815260200191505060405180910390f35b34156101b257600080fd5b6101ba610621565b6040518082815260200191505060405180910390 f35b34156101db57600080fd5b61022f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610627565b604051808215151515815260200191505060405180910390f35b3415610254576 00080fd5b61025c6109e6565b6040518082815260200191505060405180910390f35b341561027d57600080fd5b6102856109f5565b604051808260ff1660ff16815260200191505060405180910390f35b34156102ac57600080fd5b6102e1600480803573ffffffffffffffffffffffffffffffffffffffff169 060200190919080359060200190919050506109fa565b604051808215151515815260200191505060405180910390f35b341561030657600080fd5b610332600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c8b565b604051808281526020019150506040518091 0390f35b341561035357600080fd5b61035b610cd4565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561039b578082015181840152602081019050610380565b50505050905090810190601f1680156103c857808203805160018 36020036101000a031916815260200191505b509250505060405180910390f35b34156103e157600080fd5b610416600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d0d565b604051808215151515815260200191505060405180910390f3 5b341561043b57600080fd5b610470600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f31565b604051808215151515815260200191505060405180910390f35b341561049557600080fd5b6104e0600480803573fffffffffffffffffffffffffffffffffff fffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061112d565b6040518082815260200191505060405180910390f35b6040805190810160405280600b81526020017f52657370656374436f696e00000000000000000000000000000000000000000081 525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273fffffffffffffffffffff fffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b60008073ffffffffffffffffffffffffffffffffffffffff168373fffffff fffffffffffffffffffffffffffffffff161415151561066457600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156106b257600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673fffffffffffffffffffffff fffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561073d57600080fd5b61078f82600160008773ffffffffffffffffffffffffffffffffffffffff1673fffffffffffffffffffffffffffff fffffffffff168152602001908152602001600020546111b490919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061082482600160008673ffffffffffffffffffffffffffffffffffffffff1673fffffffffffffffffff fffffffffffffffffffff168152602001908152602001600020546111cd90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108f682600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffff ffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111b490919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673fffffffffffffffffffffffffffffffff fffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa 952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601260ff16600a0a6127100281565b601281565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260 200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610b0b576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008 673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b9f565b610b1e83826111b490919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200 160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7 c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808281526020019150506040518 0910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6040805190810160405280600781526020017f5245535045435400000000000000000000000000000 00000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610d4a57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115 1515610d9857600080fd5b610dea82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111b490919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020 0190815260200160002081905550610e7f82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111cd90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681 52602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006 10fc282600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111cd90919063ffffffff16565b60026000 3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373fffffffffff fffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673fffffffffffffffffff fffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373fffffffffffffffffffff fffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008282111515156111c257fe5b818303905092915050565b60008082840190508381101515156111e157fe5b80915050929150505600a165627a7a7230582025cadb1eada 4c612f0c8de847d597805ac8390d9d469e54a763a3ae1823274810029'
  • 34. ERC223 TOKEN ERC223 is backwards compatible with ERC20 merges the token transfer function among wallets and contracts into one single function ‘transfer()’ does not allow token to be transferred to a contract that does not allow token to be withdrawn
  • 35. ERC223 TOKEN INTERFACE contract ERC223 { uint public totalSupply; function balanceOf(address who) public view returns (uint); function name() public view returns (string _name); function symbol() public view returns (string _symbol); function decimals() public view returns (uint8 _decimals); function totalSupply() public view returns (uint256 _supply); function transfer(address to, uint value) public returns (bool ok); function transfer(address to, uint value, bytes data) public returns (bool ok); function transfer(address to, uint value, bytes data, string custom_fallback) public returns (bool ok); event Transfer(address indexed from, address indexed to, uint value, bytes indexed data);
  • 36. ERC721 People love collecting Allow smart contracts to operate as tradable tokens Each ERC721 is unique (non-fungible) Support “ownership” functions Each token is referenced by unique id Tokens can have metadata (attributes)
  • 37. ERC721 contract ERC721 { event Transfer(address indexed _from, address indexed _to, uint256 _tokenId); event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId); function balanceOf(address _owner) public view returns (uint256 _balance); function ownerOf(uint256 _tokenId) public view returns (address _owner); function transfer(address _to, uint256 _tokenId) public; function approve(address _to, uint256 _tokenId) public;
  • 38. STAY IN TOUCH Gene Leybzon https://www.linkedin.com/in/leybzon/ https://www.meetup.com/members/90744 20/ https://www.leybzon.com