SlideShare a Scribd company logo
ETHEREUM SMART CONTRACTS INTRO
 emanuel / br-blockchain-2
EMANUEL MOTA - @EMOTA7
Founder of Yari Labs
emanuel@yarilabs.com
@yarilabs
 emanuel / br-blockchain-2
ABOUT THE TALK
Intro
Blockchain Overview
Bitcoin vs Ethereum
Smart Contracts
Solidity
Questions
 emanuel / br-blockchain-2
INTRO
Quick questions about the audience
 emanuel / br-blockchain-2
BLOCKCHAIN OVERVIEW
 emanuel / br-blockchain-2
BLOCKCHAIN OVERVIEW
A blockchain is a globally shared, transactional
database.
everyone can read entries in the database
changes can only happen via transactions accepted
by all others
 emanuel / br-blockchain-2
BLOCKCHAIN OVERVIEW
transactions are always cryptographically signed
transactions are bundled in blocks and chained
together
 emanuel / br-blockchain-2
 emanuel / br-blockchain-2
BITCOIN
Cryptocurrency (Bitcoin)
Bitcoin Blockchain
One shared distributed ledger
Support for a "Script"
Limited smart contracts capabilities
 emanuel / br-blockchain-2
ETHEREUM
Cryptocurrency (Ether)
Bitcoin like distributed ledger
Ethereum Virtual Machine (EVM)
Turing complete
 emanuel / br-blockchain-2
ETHEREUM
Ethereum Blockchain
Contracts (code)
Storage
Logs
Events
 emanuel / br-blockchain-2
ETHEREUM
Two kinds of accounts
External Accounts (Wallets controlled by humans)
Contract Accounts (controlled by code)
every account has a balance
 emanuel / br-blockchain-2
ETHEREUM
Code execution costs GAS
Transaction is a message sent from one account to
another and can have a data payload
 emanuel / br-blockchain-2
WORLD COMPUTER ?
 emanuel / br-blockchain-2
SMART CONTRACTS
 emanuel / br-blockchain-2
SMART CONTRACTS
"A smart contract is a computer program
that directly controls digital assets and
which is run in such an environment that
it can be trusted to faithfully execute."
(Vitalik Buterin)
 emanuel / br-blockchain-2
 emanuel / br-blockchain-2
SMART CONTRACTS
 emanuel / br-blockchain-2
SOURCE FOR SMART CONTRACTS SECTION:
HTTPS://SOLIDITY.READTHEDOCS.IO/
 emanuel / br-blockchain-2
SMART CONTRACTS
Contract = code (i.e. functions) and data (its state)
that resides at a speci c address on the Ethereum
blockchain
EVM is the runtime for Smart Contracts on
Ethereum
Accounts have a persistent memory area which is
called storage: key-value store that maps 256-bit
words to 256-bit words
 emanuel / br-blockchain-2
SMART CONTRACTS
Contracts can neither read nor write to any storage
apart from its own
Contracts also have access to memory - linearly and
can be addressed at byte level
Memory is expanded by a 256bits when reading or
writing & expansion must be paid in gas
 emanuel / br-blockchain-2
SMART CONTRACTS
Contracts can call other contracts (they can even call
themselves)
1024 max call stack depth
call (new contexts) vs delegatecall (same context, e.g.
msg.sender + msg.value)
Events
Contracts can purge themselves from the blockchain
(OPCODE selfdestruct)
 emanuel / br-blockchain-2
SMART CONTRACTS
Contracts are de ned through a transaction sent to
0x000.....000 (zero acc)
Data of the transaction is the compiled contract
 emanuel / br-blockchain-2
SMART CONTRACTS PROGRAMMING LANGUAGES
Available Programming languages
Solidity (Javascript/Java like)
Serpent (Python inspired)
LLL (Lisp inspired)
others in the making ...
 emanuel / br-blockchain-2
SOLIDITY PROGRAMMING LANGUAGE
 emanuel / br-blockchain-2
SOLIDITY
SIMPLE STORAGE DEMO
Anyone can call set anytime overwriting the value.
The history would be preserved on the Blockchain.
pragma solidity ^0.4.0;
contract SimpleStorage {
uint storedData;
function set(uint x) {
storedData = x;
}
function get() constant returns (uint) {
return storedData;
}
}
 emanuel / br-blockchain-2
SOLIDITY
IMPLEMENTING YOUR OWN COIN
pragma solidity ^0.4.0;
contract Coin {
// keyword "public" exposes vars to the outside.
address public minter;
mapping (address => uint) public balances;
// Events allow light clients to react on changes.
event Sent(address from, address to, uint amount);
// The constructor is run only on creation.
function Coin() {
minter = msg.sender;
}
// continues on next page ...
 emanuel / br-blockchain-2
SOLIDITY
IMPLEMENTING YOUR OWN COIN
// from previous page ...
function mint(address receiver, uint amount) {
if (msg.sender != minter) return;
balances[receiver] += amount;
}
function send(address receiver, uint amount) {
if (balances[msg.sender] < amount) return;
balances[msg.sender] -= amount;
balances[receiver] += amount;
Sent(msg.sender, receiver, amount);
}
}
 emanuel / br-blockchain-2
SOLIDITY
STOP/REMOVE A CONTRACT FROM BLOCKCHAIN: SELFDESTRUCT !
pragma solidity ^0.4.0;
contract owned {
function owned() { owner = msg.sender; }
address owner;
}
// a contract can be derived from another contract
contract mortal is owned {
function kill() {
if (msg.sender == owner) selfdestruct(owner);
}
}
//...
}
 emanuel / br-blockchain-2
ETHEREUM CHALLENGES
 emanuel / br-blockchain-2
ETHEREUM CHALLENGES
Transaction takes a couple of minutes to be mined
Storage and execution is expensive
Ecosystem is young
 emanuel / br-blockchain-2
ETHEREUM CHALLENGES
Deal with immutability
Test contracts fully before deployment
Revert payments you don’t expect
Avoid unrecoverable states
 emanuel / br-blockchain-2
THE DAO HACK
 emanuel / br-blockchain-2
ETHEREUM CHALLENGES
EXAMPLE OF A RE-ENTRANCY ATTACK PROBLEM
This can be exploited by an external contract
msg.sender calling withdraw again (line 4) while
balance is still non zero
mapping (address => uint) private balances;
// msg.sender is a user withdrawing funds
function withdraw() public {
uint amount = balances[msg.sender];
if (!(msg.sender.call.value(amount)()))
{ revert; }
balances[msg.sender] = 0;
}
 emanuel / br-blockchain-2
INTERESTING TECHNOLOGY OFF-CHAIN
 emanuel / br-blockchain-2
INTERESTING TECHNOLOGY OFF-CHAIN
Oracles (ex: )
Whisper - comunication protocol for DApps
( )
P2P Data Storage
Swarm - distributed storage with incentives
( )
IPFS - Interplanetary Filesystem ( )
http://www.oraclize.it
https://github.com/ethereum/wiki/wiki/Whisper
https://github.com/ethersphere/swarm
https://ipfs.io
 emanuel / br-blockchain-2
SOME USEFULL LINKS
 emanuel / br-blockchain-2
SOME USEFULL LINKS
Online compiler
Another online compiler
Online tools
(block explorer, tx submit)
https://ethereum.github.io/browser-solidity/
https://etherchain.org/solc
https://testnet.etherscan.io
https://etherscan.io
 emanuel / br-blockchain-2
SOME USEFULL LINKS
(contract repository w/
source code)
Infura.io (so you don’t have to run your own node/s)
Truf e .
Embark
Open Zeppelin
https://etherchain.org/
http://ether.fund/contracts/
https://github.com/ConsenSys/truf e
https://github.com/iurimatias/embark-
framework
https://openzeppelin.org/
 emanuel / br-blockchain-2
QUESTIONS ?
@yarilabs
 emanuel / br-blockchain-2
EMANUEL MOTA
@YARILABS
emanuel@yarilabs.com
twitter: @emota7
github: emanuel
HTTP://YARILABS.COM
 emanuel / br-blockchain-2

More Related Content

What's hot (20)

PPTX
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Tomoaki Sato
 
PDF
WebRTC ... GWT & in-browser computation
JooinK
 
PPTX
Kriptovaluták, hashbányászat és okoscicák
hackersuli
 
PDF
Secrecy and Authenticity Properties of the Lightning Network Protocol
Hans Hyttel
 
PDF
Understanding c# for java
sagaroceanic11
 
PDF
Certified Pseudonym Colligated with Master Secret Key
Vijay Pasupathinathan, PhD
 
PDF
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
Zvi Avraham
 
PDF
Understanding hd wallets design and implementation
ArcBlock
 
PPTX
Blockchain privacy approaches in hyperledger indy
ManishKumarGiri2
 
PDF
Unconventional webapps with gwt:elemental & html5
firenze-gtug
 
ODP
Applying Security Algorithms Using openSSL crypto library
Priyank Kapadia
 
PDF
Blockchain - Introduction and Authoring Smart Contracts
Vikas Grover
 
PDF
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing - Node.j...
Luciano Mammino
 
PDF
Iot hub agent
rtfmpliz1
 
PPT
Encryption
Mahmoud Abdeen
 
PDF
Ergo Hong Kong meetup
Dmitry Meshkov
 
PPT
Digital signature schemes
ravik09783
 
PDF
03 - Qt UI Development
Andreas Jakl
 
PDF
DASP Top10 for OWASP Thailand Chapter by s111s
s111s object
 
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Tomoaki Sato
 
WebRTC ... GWT & in-browser computation
JooinK
 
Kriptovaluták, hashbányászat és okoscicák
hackersuli
 
Secrecy and Authenticity Properties of the Lightning Network Protocol
Hans Hyttel
 
Understanding c# for java
sagaroceanic11
 
Certified Pseudonym Colligated with Master Secret Key
Vijay Pasupathinathan, PhD
 
Ethereum VM and DSLs for Smart Contracts (updated on May 12th 2015)
Zvi Avraham
 
Understanding hd wallets design and implementation
ArcBlock
 
Blockchain privacy approaches in hyperledger indy
ManishKumarGiri2
 
Unconventional webapps with gwt:elemental & html5
firenze-gtug
 
Applying Security Algorithms Using openSSL crypto library
Priyank Kapadia
 
Blockchain - Introduction and Authoring Smart Contracts
Vikas Grover
 
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing - Node.j...
Luciano Mammino
 
Iot hub agent
rtfmpliz1
 
Encryption
Mahmoud Abdeen
 
Ergo Hong Kong meetup
Dmitry Meshkov
 
Digital signature schemes
ravik09783
 
03 - Qt UI Development
Andreas Jakl
 
DASP Top10 for OWASP Thailand Chapter by s111s
s111s object
 

Similar to Braga Blockchain - Ethereum Smart Contracts programming (20)

PDF
Programming smart contracts in solidity
Emanuel Mota
 
PDF
Introduction to Blockchain with an Ethereuem Hands-on
Johann Romefort
 
PDF
Blockchain and smart contracts, what they are and why you should really care ...
maeste
 
PPTX
Hello world contract
Gene Leybzon
 
PPTX
Ethereum
V C
 
ODP
Stefano Maestri - Blockchain and smart contracts, what they are and why you s...
Codemotion
 
PDF
Grokking TechTalk #17: Introduction to blockchain
Grokking VN
 
PDF
solutions.hamburg | web3 // smart contracts // ethereum
Maximilian Reichel
 
PDF
Part 4: Understanding the working of Smart Contracts
Jyoti Yadav
 
PPTX
Blockchain for Developers
Shimi Bandiel
 
PDF
Writing smart contracts
Marek Kirejczyk
 
PDF
Smart contracts in Solidity
Felix Crisan
 
PPTX
Smart Contract programming 101 with Solidity #PizzaHackathon
Sittiphol Phanvilai
 
PDF
Blockchain School 2019 - Security of Smart Contracts.pdf
Davide Carboni
 
PDF
“Create your own cryptocurrency in an hour” - Sandip Pandey
EIT Digital Alumni
 
PPTX
Hands on with smart contracts 2. Presentation for the Blockchain Applications...
Gene Leybzon
 
PDF
Building Apps with Ethereum Smart Contract
Vaideeswaran Sethuraman
 
PPTX
Ethereum (Blockchain Network)
Qais Ammari
 
PDF
An Introduction to Upgradable Smart Contracts
Mark Smalley
 
PPTX
Ethereum Block Chain
SanatPandoh
 
Programming smart contracts in solidity
Emanuel Mota
 
Introduction to Blockchain with an Ethereuem Hands-on
Johann Romefort
 
Blockchain and smart contracts, what they are and why you should really care ...
maeste
 
Hello world contract
Gene Leybzon
 
Ethereum
V C
 
Stefano Maestri - Blockchain and smart contracts, what they are and why you s...
Codemotion
 
Grokking TechTalk #17: Introduction to blockchain
Grokking VN
 
solutions.hamburg | web3 // smart contracts // ethereum
Maximilian Reichel
 
Part 4: Understanding the working of Smart Contracts
Jyoti Yadav
 
Blockchain for Developers
Shimi Bandiel
 
Writing smart contracts
Marek Kirejczyk
 
Smart contracts in Solidity
Felix Crisan
 
Smart Contract programming 101 with Solidity #PizzaHackathon
Sittiphol Phanvilai
 
Blockchain School 2019 - Security of Smart Contracts.pdf
Davide Carboni
 
“Create your own cryptocurrency in an hour” - Sandip Pandey
EIT Digital Alumni
 
Hands on with smart contracts 2. Presentation for the Blockchain Applications...
Gene Leybzon
 
Building Apps with Ethereum Smart Contract
Vaideeswaran Sethuraman
 
Ethereum (Blockchain Network)
Qais Ammari
 
An Introduction to Upgradable Smart Contracts
Mark Smalley
 
Ethereum Block Chain
SanatPandoh
 
Ad

Recently uploaded (20)

PDF
Meetup Kickoff & Welcome - Rohit Yadav, CSIUG Chairman
ShapeBlue
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
Human-centred design in online workplace learning and relationship to engagem...
Tracy Tang
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PDF
Persuasive AI: risks and opportunities in the age of digital debate
Speck&Tech
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PPTX
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
PDF
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Français Patch Tuesday - Juillet
Ivanti
 
PPTX
Extensions Framework (XaaS) - Enabling Orchestrate Anything
ShapeBlue
 
PDF
TrustArc Webinar - Data Privacy Trends 2025: Mid-Year Insights & Program Stra...
TrustArc
 
Meetup Kickoff & Welcome - Rohit Yadav, CSIUG Chairman
ShapeBlue
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
Human-centred design in online workplace learning and relationship to engagem...
Tracy Tang
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
Persuasive AI: risks and opportunities in the age of digital debate
Speck&Tech
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Français Patch Tuesday - Juillet
Ivanti
 
Extensions Framework (XaaS) - Enabling Orchestrate Anything
ShapeBlue
 
TrustArc Webinar - Data Privacy Trends 2025: Mid-Year Insights & Program Stra...
TrustArc
 
Ad

Braga Blockchain - Ethereum Smart Contracts programming

  • 1. ETHEREUM SMART CONTRACTS INTRO  emanuel / br-blockchain-2
  • 2. EMANUEL MOTA - @EMOTA7 Founder of Yari Labs [email protected] @yarilabs  emanuel / br-blockchain-2
  • 3. ABOUT THE TALK Intro Blockchain Overview Bitcoin vs Ethereum Smart Contracts Solidity Questions  emanuel / br-blockchain-2
  • 4. INTRO Quick questions about the audience  emanuel / br-blockchain-2
  • 6. BLOCKCHAIN OVERVIEW A blockchain is a globally shared, transactional database. everyone can read entries in the database changes can only happen via transactions accepted by all others  emanuel / br-blockchain-2
  • 7. BLOCKCHAIN OVERVIEW transactions are always cryptographically signed transactions are bundled in blocks and chained together  emanuel / br-blockchain-2
  • 8.  emanuel / br-blockchain-2
  • 9. BITCOIN Cryptocurrency (Bitcoin) Bitcoin Blockchain One shared distributed ledger Support for a "Script" Limited smart contracts capabilities  emanuel / br-blockchain-2
  • 10. ETHEREUM Cryptocurrency (Ether) Bitcoin like distributed ledger Ethereum Virtual Machine (EVM) Turing complete  emanuel / br-blockchain-2
  • 12. ETHEREUM Two kinds of accounts External Accounts (Wallets controlled by humans) Contract Accounts (controlled by code) every account has a balance  emanuel / br-blockchain-2
  • 13. ETHEREUM Code execution costs GAS Transaction is a message sent from one account to another and can have a data payload  emanuel / br-blockchain-2
  • 14. WORLD COMPUTER ?  emanuel / br-blockchain-2
  • 15. SMART CONTRACTS  emanuel / br-blockchain-2
  • 16. SMART CONTRACTS "A smart contract is a computer program that directly controls digital assets and which is run in such an environment that it can be trusted to faithfully execute." (Vitalik Buterin)  emanuel / br-blockchain-2
  • 17.  emanuel / br-blockchain-2
  • 18. SMART CONTRACTS  emanuel / br-blockchain-2
  • 19. SOURCE FOR SMART CONTRACTS SECTION: HTTPS://SOLIDITY.READTHEDOCS.IO/  emanuel / br-blockchain-2
  • 20. SMART CONTRACTS Contract = code (i.e. functions) and data (its state) that resides at a speci c address on the Ethereum blockchain EVM is the runtime for Smart Contracts on Ethereum Accounts have a persistent memory area which is called storage: key-value store that maps 256-bit words to 256-bit words  emanuel / br-blockchain-2
  • 21. SMART CONTRACTS Contracts can neither read nor write to any storage apart from its own Contracts also have access to memory - linearly and can be addressed at byte level Memory is expanded by a 256bits when reading or writing & expansion must be paid in gas  emanuel / br-blockchain-2
  • 22. SMART CONTRACTS Contracts can call other contracts (they can even call themselves) 1024 max call stack depth call (new contexts) vs delegatecall (same context, e.g. msg.sender + msg.value) Events Contracts can purge themselves from the blockchain (OPCODE selfdestruct)  emanuel / br-blockchain-2
  • 23. SMART CONTRACTS Contracts are de ned through a transaction sent to 0x000.....000 (zero acc) Data of the transaction is the compiled contract  emanuel / br-blockchain-2
  • 24. SMART CONTRACTS PROGRAMMING LANGUAGES Available Programming languages Solidity (Javascript/Java like) Serpent (Python inspired) LLL (Lisp inspired) others in the making ...  emanuel / br-blockchain-2
  • 25. SOLIDITY PROGRAMMING LANGUAGE  emanuel / br-blockchain-2
  • 26. SOLIDITY SIMPLE STORAGE DEMO Anyone can call set anytime overwriting the value. The history would be preserved on the Blockchain. pragma solidity ^0.4.0; contract SimpleStorage { uint storedData; function set(uint x) { storedData = x; } function get() constant returns (uint) { return storedData; } }  emanuel / br-blockchain-2
  • 27. SOLIDITY IMPLEMENTING YOUR OWN COIN pragma solidity ^0.4.0; contract Coin { // keyword "public" exposes vars to the outside. address public minter; mapping (address => uint) public balances; // Events allow light clients to react on changes. event Sent(address from, address to, uint amount); // The constructor is run only on creation. function Coin() { minter = msg.sender; } // continues on next page ...  emanuel / br-blockchain-2
  • 28. SOLIDITY IMPLEMENTING YOUR OWN COIN // from previous page ... function mint(address receiver, uint amount) { if (msg.sender != minter) return; balances[receiver] += amount; } function send(address receiver, uint amount) { if (balances[msg.sender] < amount) return; balances[msg.sender] -= amount; balances[receiver] += amount; Sent(msg.sender, receiver, amount); } }  emanuel / br-blockchain-2
  • 29. SOLIDITY STOP/REMOVE A CONTRACT FROM BLOCKCHAIN: SELFDESTRUCT ! pragma solidity ^0.4.0; contract owned { function owned() { owner = msg.sender; } address owner; } // a contract can be derived from another contract contract mortal is owned { function kill() { if (msg.sender == owner) selfdestruct(owner); } } //... }  emanuel / br-blockchain-2
  • 30. ETHEREUM CHALLENGES  emanuel / br-blockchain-2
  • 31. ETHEREUM CHALLENGES Transaction takes a couple of minutes to be mined Storage and execution is expensive Ecosystem is young  emanuel / br-blockchain-2
  • 32. ETHEREUM CHALLENGES Deal with immutability Test contracts fully before deployment Revert payments you don’t expect Avoid unrecoverable states  emanuel / br-blockchain-2
  • 33. THE DAO HACK  emanuel / br-blockchain-2
  • 34. ETHEREUM CHALLENGES EXAMPLE OF A RE-ENTRANCY ATTACK PROBLEM This can be exploited by an external contract msg.sender calling withdraw again (line 4) while balance is still non zero mapping (address => uint) private balances; // msg.sender is a user withdrawing funds function withdraw() public { uint amount = balances[msg.sender]; if (!(msg.sender.call.value(amount)())) { revert; } balances[msg.sender] = 0; }  emanuel / br-blockchain-2
  • 35. INTERESTING TECHNOLOGY OFF-CHAIN  emanuel / br-blockchain-2
  • 36. INTERESTING TECHNOLOGY OFF-CHAIN Oracles (ex: ) Whisper - comunication protocol for DApps ( ) P2P Data Storage Swarm - distributed storage with incentives ( ) IPFS - Interplanetary Filesystem ( ) http://www.oraclize.it https://github.com/ethereum/wiki/wiki/Whisper https://github.com/ethersphere/swarm https://ipfs.io  emanuel / br-blockchain-2
  • 37. SOME USEFULL LINKS  emanuel / br-blockchain-2
  • 38. SOME USEFULL LINKS Online compiler Another online compiler Online tools (block explorer, tx submit) https://ethereum.github.io/browser-solidity/ https://etherchain.org/solc https://testnet.etherscan.io https://etherscan.io  emanuel / br-blockchain-2
  • 39. SOME USEFULL LINKS (contract repository w/ source code) Infura.io (so you don’t have to run your own node/s) Truf e . Embark Open Zeppelin https://etherchain.org/ http://ether.fund/contracts/ https://github.com/ConsenSys/truf e https://github.com/iurimatias/embark- framework https://openzeppelin.org/  emanuel / br-blockchain-2
  • 41. EMANUEL MOTA @YARILABS [email protected] twitter: @emota7 github: emanuel HTTP://YARILABS.COM  emanuel / br-blockchain-2