Skip to content

Instantly share code, notes, and snippets.


Karl Floersch karlfloersch

View GitHub Profile
View EOAProxy.sol
pragma solidity ^0.7.0;
contract EOAProxy {
address implementation = DEFAULT_IMPL_ADDR;
function _eoaUpgrade(address _newImplementation) external {
require(msg.sender == address(this));
implementation = _newImplementation;
fallback() external {
address impl = implementation;
View BaseCrossDomainMessenger.sol
pragma solidity ^0.5.0;
/* Interface Imports */
import { ICrossDomainMessenger } from "./interfaces/CrossDomainMessenger.interface.sol";
* @title BaseCrossDomainMessenger
contract BaseCrossDomainMessenger is ICrossDomainMessenger {
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)