Skip to content

Instantly share code, notes, and snippets.

View evertonfraga's full-sized avatar

Ev evertonfraga

View GitHub Profile
/**
* Some cool JavaScript prototypes.
* Author: Everton Fraga <everton{shift+2}kindaconnected.com>
*
*/
/*
* Number.times:Array
* Param: int n
@evertonfraga
evertonfraga / ethdev.md
Last active August 25, 2017 22:41
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
pragma solidity ^0.4.5;
contract MyToken {
/*
Variáveis públicas do token.
Elas conformam com o padrão de moedas na rede ethereum, este padrão permite integração
com as Wallets e interoperabilidade com outros contratos.
Standard ERC 20: https://github.com/ethereum/EIPs/issues/20
*/
string public standard = 'Token 0.1';
pragma solidity ^0.4.5;
/*
Ether Splitter é um simples contrato que divide o
ether enviado entre dois endereços.
*/
contract EtherSplitter {
// Definição de evento.
pragma solidity ^0.4.5;
/*
Cadastrando itens em um struct
*/
contract VipClub {
// Estrutura de dados Member, que possui os atributos `name` e `email`
struct Member {
string name;
{
"address": "84491dabc6366120bca1801b3223cc60b693e999",
"crypto": {
"cipher": "aes-128-ctr",
"ciphertext": "b2499f41a70f9792cf6444e150d256c8ad41ee009b5a54bf6e50c073630f06e4",
"cipherparams": {
"iv": "690c2b57b2f7389aae8f452ce0b2fc2c"
},
"kdf": "scrypt",
"kdfparams": {
pragma solidity ^0.4.8;
contract tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); }
contract MyToken {
/* Public variables of the token */
string public standard = 'Token 0.1';
string public name;
string public symbol;
uint8 public decimals;
@evertonfraga
evertonfraga / ethereum-dev-mode.md
Last active June 22, 2022 11:55
Set up an Ethereum development network in two minutes
0xAB3a5216307C0eBAdad8D70900aa7dB20dcE1EDe
@evertonfraga
evertonfraga / Distribuição de ether
Last active October 5, 2017 20:58
PROSPERA - Outubro: Distribuição de ether e Emissão de PRSP
// https://etherscan.io/address/0xa4e23286c06208645f52c57a6ef5a510e87a6d76
const Web3 = require('web3');
// const web3 = new Web3(Web3.providers.HttpProvider('https://mainnet.infura.io/bnr6Lt3Xle02EzHa3Bf5 '));
const web3 = new Web3(Web3.providers.HttpProvider('http://localhost:8545 '));
var txs = [];
var cb = function(err, hash) { txs.push(hash); console.log(err, 'https://etherscan.io/tx/'+hash) };
var myAccount = '0xa4E23286C06208645f52c57A6eF5a510e87A6d76';