Skip to content

Instantly share code, notes, and snippets.

View trigun0x2's full-sized avatar

Jeffrey Tong trigun0x2

View GitHub Profile
@trigun0x2
trigun0x2 / sendRawTransaction.js
Created April 5, 2018 07:19 — forked from raineorshine/sendRawTransaction.js
Sends a raw transaction with web3 v1.0 and Infura
const Web3 = require('web3')
const Tx = require('ethereumjs-tx')
// connect to Infura node
const web3 = new Web3(new Web3.providers.HttpProvider('https://mainnet.infura.io/INFURA_KEY'))
// the address that will send the test transaction
const addressFrom = '0x1889EF49cDBaad420EB4D6f04066CA4093088Bbd'
const privKey = 'PRIVATE_KEY'
/**
* Base contract that all upgradeable contracts should use.
*
* Contracts implementing this interface are all called using delegatecall from
* a dispatcher. As a result, the _sizes and _dest variables are shared with the
* dispatcher contract, which allows the called contract to update these at will.
*
* _sizes is a map of function signatures to return value sizes. Due to EVM
* limitations, these need to be populated by the target contract, so the
* dispatcher knows how many bytes of data to return from called functions.
@trigun0x2
trigun0x2 / JS Loading in web frameworks like Elixir
Created February 9, 2016 22:06 — forked from napcs/JS Loading in web frameworks like Elixir
Per-view JavaScript functions for Phoenix. Keeps things out of global space, allows a page to specifically invoke the JS it needs.
How to load page-specific JS functions and pass values to those functions when JS is loaded below your views.