Skip to content

Instantly share code, notes, and snippets.


Ev evertonfraga

View GitHub Profile
evertonfraga / delegatecall.sol
Last active Dec 19, 2017
Prevent library direct code execution
View delegatecall.sol
This code snippet aims to show how to prevent library methods from being executed directly.
That's achieved by baking in the address of the library before it's deployed, then comparing `address(this)` against the saved address within a modifier.
A contract/library address is deterministic, so one could inject that in: keccak256(creator_address, nonceValue).
Thanks to @pirapira, @chriseth and @arachnid for the idea.
evertonfraga / ABI
Last active Oct 13, 2017
Exemplo de entrega de projeto
View ABI
evertonfraga / Distribuição de ether
Last active Oct 5, 2017
PROSPERA - Outubro: Distribuição de ether e Emissão de PRSP
View Distribuição de ether
const Web3 = require('web3');
// const web3 = new Web3(Web3.providers.HttpProvider(' '));
const web3 = new Web3(Web3.providers.HttpProvider('http://localhost:8545 '));
var txs = [];
var cb = function(err, hash) { txs.push(hash); console.log(err, ''+hash) };
var myAccount = '0xa4E23286C06208645f52c57A6eF5a510e87A6d76';
evertonfraga /
Last active Jul 16, 2020
Set up an Ethereum development network in two minutes
View MyToken.sol
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;
View privatekey-example
"address": "84491dabc6366120bca1801b3223cc60b693e999",
"crypto": {
"cipher": "aes-128-ctr",
"ciphertext": "b2499f41a70f9792cf6444e150d256c8ad41ee009b5a54bf6e50c073630f06e4",
"cipherparams": {
"iv": "690c2b57b2f7389aae8f452ce0b2fc2c"
"kdf": "scrypt",
"kdfparams": {
View VipClub.sol
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;
View EtherSplitter.sol
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.
View MyToken.sol
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:
string public standard = 'Token 0.1';
You can’t perform that action at this time.