Skip to content

Instantly share code, notes, and snippets.

View arhuaco's full-sized avatar

Nelson Castillo arhuaco

  • Earth
View GitHub Profile
@arhuaco
arhuaco / gist:d034b64caaeafd17b456
Created June 10, 2015 07:10
Random Solidity Contract
contract SimpleStorage
{
uint r0 = 1;
uint r1 = 1;
function iterate ()
{
r0 = ((msg.value + r1) + (block.number + r0));
r1 = ((block.number + block.difficulty) + (msg.value + tx.gasprice));
}
}
@arhuaco
arhuaco / gist:a36854ff9aa0901c6267
Created May 21, 2015 17:48
Issue calling contract
> var contract_address = '0x5a219cab7d5a5888ae86e80de2775dc022de6e0c';
undefined
> abiDef = [{ type: 'function', constant: true, inputs: [ ], name: 'step', outputs: [{name: 'retVal', type: 'uint256' } ] }]
[{
type: 'function',
constant: true,
inputs: [ ],
name: 'step',
outputs: [{
name: 'retVal',
@arhuaco
arhuaco / 0_reuse_code.js
Created August 12, 2014 20:03
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console