Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introducción a la programación de contratos inteligentes con Solidity para Ethereum

Introducción a la programación de contratos inteligentes con Solidity para Ethereum

Mesi Rendón

March 02, 2018
Tweet

More Decks by Mesi Rendón

Other Decks in Programming

Transcript

  1. Introducción a programación de contratos inteligentes con Solidity para Ethereum

    Angel Mesías Rendón @mesirendon Investigador y Desarrollador Blockchain Grupo InTIColombia
  2. DLT

  3. Ethereum • Plataforma descentralizada • Dapps sobre Ethereum • Accounts

    • Transacciones • Consenso • Equivalencias • EVM • Gas 1 Ether = 1000000000000000000 Wei 1 Ether = 1000000000000000 Kwei 1 Ether = 1000000000000 Mwei 1 Ether = 1000000000 Gwei 1 Ether = 1000000 Szabo 1 Ether = 1000 Finney 1 Ether = 0.001 Kether 1 Ether = 0.000001 Mether 1 Ether = 0.000000001 Gether 1 Ether = 0.000000000001 Tether
  4. Solidity • Lenguaje de programación orientado a contratos • C++,

    Python, JavaScript • Estáticamente tipado, herencia, librerías, tipos definidos por usuario • La Ethereum Virtual Machine corre en la red de Ethereum
  5. Ambiente • NodeJS • Nvm - https://github.com/creationix/nvm • NodeJS –

    nvm install node • Yarn - https://yarnpkg.com/en/ • Truffle • Ganache npm i -g ganache-cli • Truffle Framework npm i -g truffle • Front end • VueJS npm i -g vue-cli • Truffle Contract yarn add vue-cli • Web3JS yarn add web3 • Browser • MetaMask https://metamask.io/
  6. Tipos de Datos • bool • uint8, uint16, uint24, …,

    uint256 (aplica para int, ufixed, fixed) • address (balance, send) • Arrays ◦ bytes1, bytes2, bytes3, …, bytes32 • String (bytes(raw), strings(UTF-8)) • Structs • Enums • Mappings
  7. Estructuras de Control • if • else • while •

    for • break • continue • return • ?: • Error handling: Assert, Require, Revert and Exceptions