Skip to content

Instantly share code, notes, and snippets.

Avatar

Nick Dodson SilentCicero

View GitHub Profile
View MiniMeStandardToken.sol
/*
You should inherit from StandardToken or, for a token like you would want to
deploy in something like Mist, see HumanStandardToken.sol.
(This implements ONLY the standard functions and NOTHING else.
If you deploy this, you won't have anything useful.)
Implements ERC 20 Token standard: https://github.com/ethereum/EIPs/issues/20
.*/
pragma solidity ^0.4.8;
View addr
0xE4660fdAb2D6Bd8b50C029ec79E244d132c3bc2B
View TestJS
console.log('hello world!');
console.log(window.parent.governx);
View intToDecimal.js
const BN = require('bn.js');
const stripHexPrefix = val => typeof val === 'string' && val.indexOf('0x') === 0 ? val.slice(2) : val;
const hexPrefix = val => val ? (`0x${stripHexPrefix((val || {}).div ? val.toString(16) : val)}`) : val;
const hexToBN = val => (val || {}).div ? val : new BN(stripHexPrefix(hexPrefix(val)), 16);
const numToBN = val => (val || {}).div || String(val).indexOf('0x') !== -1 ? hexToBN(val) : new BN(val, 10);
function intToDecimal(weiInput, baseLength, optionsInput) {
var wei = numToBN(weiInput); // eslint-disable-line
var negative = wei.lt(new BN(0)); // eslint-disable-line
@SilentCicero
SilentCicero / Getting_Started_with_Fuel_in_NodeJS.js
Last active May 2, 2020
The NodeJS example code from the recent Fuel tutorial blog post.
View Getting_Started_with_Fuel_in_NodeJS.js
const { Wallet, utils, dbs } = require("fuel-core");
(async () => {
// DB and Key Setup
const db = new dbs.Level(); // persisting db
const privateKey = (await db.get('key')) || utils.randomBytes(32);
await db.put('key', privateKey);
You can’t perform that action at this time.