Skip to content

Instantly share code, notes, and snippets.

View falehenrique's full-sized avatar
🏠
Working from home

Henrique Leite falehenrique

🏠
Working from home
View GitHub Profile
@falehenrique
falehenrique / ethdev.md
Created December 9, 2016 01:25 — forked from evertonfraga/ethdev.md
Ambiente de desenvolvimento Ethereum

Ambiente de desenvolvimento para Ethereum

Este mini-guia compreende as ferramentas necessárias para executar contratos com o Mist e desenvolver Dapps utilizando uma rede local privada.

INSTALAÇÃO

  1. Instalar Mist
0x329b5b7c699c2bc3bff7ecbcb0ae29f5ce1f811e
@falehenrique
falehenrique / gist:15a392b256e919d808e6c713936e580e
Created November 13, 2017 13:28
Meetup Blockchain e Chatbot 11/11/2017 - node.js
var express = require('express');
var app = express();
var server = require('http').createServer(app);
var bodyParser = require('body-parser')
app.use( bodyParser.json() );
app.use(bodyParser.urlencoded({
extended: true
}));
public function getDimensions(&$products)
{
$width = 0;
$height = 0;
$depth = 0;
$weight = 0;
foreach ($products as &$product) {
if ($product['weight']) {
if (self::$weightUnit == 'KGS') {
@falehenrique
falehenrique / .sol
Created December 16, 2017 01:33
TOKEN ERC223
pragma solidity ^0.4.18;
/* New ERC23 contract interface */
//https://github.com/ethereum/EIPs/issues/223
contract ERC223 {
// Get the total token supply
function totalSupply() public constant returns (uint _supply);
//Compatibility with ERC20 transfer
function transfer(address to, uint value) public returns (bool ok);
@falehenrique
falehenrique / ERC223Token.sol
Created December 16, 2017 10:37
GO Dev 1 - Contratos Aula 16/12/2017
pragma solidity ^0.4.18;
//https://github.com/ethereum/EIPs/issues/223
contract ERC223Token {
string public name = "GoBlockchain Token";
uint8 public decimals = 0;
string public symbol = "GBC";
string public version = "GBC 1.0";
uint256 public totalSupply;
mapping(address => uint) balancesOf;
@falehenrique
falehenrique / .sol
Created December 16, 2017 16:24
ContratoPessoa.sol
// prama informa a EVM a versão do solidity,
pragma solidity ^0.4.18;
contract Pessoa {
//variável do tipo string
string public nome;
string public email;
//eventos
event LogPersonEmailAlterado(address _pessoa, string emailAlterado);
// construtor
@falehenrique
falehenrique / sol
Created January 18, 2018 20:11
RegisterNameToken
//defini a versão de compilação do solidty
pragma solidity ^0.4.18;
contract RegisterNameToken {
//variável map onde a chave é uma array de bytes e o valor booleano(true ou false)
mapping (bytes32=>bool) mapNames;
//array de bytes
bytes32[] public names;
//evento para ser utilizado como callback pela nossa aplicação web
event LogNameRegistered(string _name, uint256 time);
@falehenrique
falehenrique / DepositWithdraw.sol
Last active February 19, 2018 11:29
Contract Deposit with withdraw function
pragma solidity 0.4.18;
contract DepositWithdraw {
address private owner;
event LogDebug(uint256 amount);
event LogDepositReceived(address sender, uint256 value);
Depositor[] public depositors;
function DepositWithdraw() public {
owner = msg.sender;