Skip to content

Instantly share code, notes, and snippets.


Karl Floersch karlfloersch

Block or report user

Report or block karlfloersch

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View casper_abi.json
[{'name': '__init__', 'outputs': [], 'inputs': [{'type': 'int128', 'name': '_epoch_length'}, {'type': 'int128', 'name': '_withdrawal_delay'}, {'type': 'address', 'name': '_owner'}, {'type': 'address', 'name': '_sighasher'}, {'type': 'address', 'name': '_purity_checker'}, {'type': 'decimal10', 'name': '_base_interest_factor'}, {'type': 'decimal10', 'name': '_base_penalty_factor'}, {'type': 'int128', 'name': '_min_deposit_size'}], 'constant': False, 'payable': False, 'type': 'constructor'}, {'name': 'get_main_hash_voted_frac', 'outputs': [{'type': 'decimal10', 'name': 'out'}], 'inputs': [], 'constant': True, 'payable': False, 'type': 'function'}, {'name': 'get_deposit_size', 'outputs': [{'type': 'int128', 'name': 'out'}], 'inputs': [{'type': 'int128', 'name': 'validator_index'}], 'constant': True, 'payable': False, 'type': 'function'}, {'name': 'get_total_curdyn_deposits', 'outputs': [{'type': 'int128', 'name': 'out'}], 'inputs': [], 'constant': True, 'payable': False, 'type': 'function'}, {'name': 'get_total_p
View casper_chat_log.txt
09:08:37 From Joseph Chow : (Time 1 seems dangling in these slides)
09:09:01 From jonchoi : +1
09:10:04 From lanerettig : BTC POW currently burns as much energy as Ecuador… not a tiny country
09:11:18 From jonchoi : yep also worth mentioning PoS uses potential value at loss as the incentive as opposed to realized opex in PoW
09:12:04 From lanerettig : what does “finality” really mean in a world where someone can disagree, rewind, and fork anyway?
09:12:30 From @M : I think it means they can’t rewind and fork?
09:12:46 From danny : it would require manual intervention
09:12:53 From danny : can always fork :)
09:16:09 From @M : Is Phil’s question presenting a difference between a “protocol changing fork”, and a reorganization which just rewinds and builds on a previous block?
09:19:53 From aparnakrishnan : Is there any reason for choosing 50 blocks to be the epoch?
View CommitRevealElection.sol
pragma solidity ^0.4.7;
contract CommitRevealElection {
// The two choices for your vote
string public choice1;
string public choice2;
// Information about the current status of the vote
uint public votesForChoice1;
uint public votesForChoice2;
karlfloersch / index.html
Last active Aug 15, 2016
A basic web3 starter. It requires some work, it's intended use is for the Lotto contract
View index.html
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>Hello World</title>
if (typeof web3 !== 'undefined') {
View SimpleLotto.sol
pragma solidity ^0.4.4;
contract Lotto {
uint constant public maxTickets = 5;
uint public currentTickets = 0;
mapping(uint=>address) participants;
event logString(string x);
View Getting Started with Ethereum


  • Web3.js: A Javascript library letting you interact with any Ethereum node using the RPC network protocol.
  • Geth: A heavyweight Ethereum node
  • Testrpc: A Ethereum node simulator (fast and good for development)
  • Pudding: A library wrapping web3.js providing a nicer interface for interacting with the node/sending transactions.
  • Truffle: A framework good for JS developers who want to build prototypes and don't mind the restrictions it imposes. For more customization, just use plain JS, web3.js, and pudding.
  • Solc: The Solidity compiler


karlfloersch /
Created May 1, 2016
A dockerized Ethereum Dapp architecture
karlfloersch / index.js
Created Apr 4, 2016 — forked from mogelbrod/index.js
Simple apply-loader module for webpack
View index.js
var loaderUtils = require('loader-utils');
module.exports = function(source) {
this.cacheable && this.cacheable();
var query = loaderUtils.parseQuery(this.query);
var args = [];
// apply?config=key => sourceFn(require('webpack.config').key)
if (typeof query.config === 'string') {
if (!query.config in this.options)
karlfloersch / wrapAsFn.js
Last active Mar 16, 2016
Webpack loader that wraps a JS file in a function so that you can inject variables to be modified. Original Author: @IngwiePhoenix
View wrapAsFn.js
var loaderUtils = require("loader-utils"); //
module.exports = function WrapAsFnLoader(source) {
var query = loaderUtils.parseQuery(this.query);
var exportVars = query.exports;
var exStmt = [];
// Build the local variables by using the exports property on the query.
// This allows us to turn a couple this-variables into locals.
// Use a string to indicate that you want to import it as the same name,
// alternatively, provide an array of key-value pairs: The key becomes the local var,
View OpenWeatherMap + OpenLayers 3 Cloud Cover Example
<!DOCTYPE html>
<html lang="en">
<link rel="stylesheet" href="" type="text/css">
.map {
height: 400px;
width: 100%;
You can’t perform that action at this time.