Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrew Miller amiller

View GitHub Profile
View ensfast.sol
pragma solidity ^0.5.0;
contract MyContract {
// 0x83CC162a944afA8537DAaDec8f39C88E4B6c4E31 mainnet registry
// mainnet resolver
// 0x12a0083531C904fe4ac490DF231c2e4e4403dB60 ropsten registry
// 0x12299799a50340FB860D276805E78550cBaD3De3 ropsten resolver
ETHRegistrarController registrar = ETHRegistrarController(0x12a0083531C904fe4ac490DF231c2e4e4403dB60);
BaseRegistrar base = BaseRegistrar(0x227Fcb6Ddf14880413EF4f1A3dF2Bbb32bcb29d7);
@amiller
amiller / stakepoll.py
Last active Dec 1, 2019
Stake poll update code
View stakepoll.py
import json, sys
import subprocess
import requests
import time
import csv
import re
balances = {} # map addr => balance
# Parse the vote string
View soliditysignatures.sol
pragma solidity ^0.4.22;
contract ECVerify {
function ecrecovery(bytes32 hash, bytes sig) public pure returns (address) {
bytes32 r;
bytes32 s;
uint8 v;
if (sig.length != 65) {
return 0;
View threadpyo3.py
import asyncio
import concurrent.futures
import logging
import time
import random
# Examples of running in executor
# https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.ThreadPoolExecutor
# https://pymotw.com/3/asyncio/executors.html
View threadcffi.py
import asyncio
import concurrent.futures
import logging
import time
import cffi
import random
# Examples of running in executor
# https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.ThreadPoolExecutor
# https://pymotw.com/3/asyncio/executors.html
@amiller
amiller / Auction-template.sol
Last active Nov 25, 2018 — forked from jcb82/ArbitrationTest.sol
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.19+commit.c4cbbb05.js&optimize=undefined&gist=
View Auction-template.sol
pragma solidity ^0.4.22;
import "gist/Timer.sol";
contract Auction {
address internal timerAddress;
address internal sellerAddress;
address internal winnerAddress;
// constructor
@amiller
amiller / TinyDuplex.sol
Last active May 13, 2019
TinyDuplex.sol: minimalist duplex micropayment channel for Ethereum
View TinyDuplex.sol
pragma solidity ^0.4.22;
// ECE 398 SC - Smart Contracts and Blockchain Security
// http://soc1024.ece.illinois.edu/teaching/ece398sc/spring2018/
// Simpest possible duplex-micropayment channel
// - Funded with an up front amount at initialization
// - The contract creator is called "alice". The other party, "bob", is passed
// as an argument to the Constructor
// - There is no fixed deadline, but instead any party can initiate a dispute,
// which lasts for a fixed time
View hw2-intro.sol
pragma solidity ^0.4.21;
// ECE 398 SC - Smart Contracts and Blockchain Security
// http://soc1024.ece.illinois.edu/teaching/ece398sc/spring2018/
contract SolidityChallenges {
// 1. Simple syntax
function arithmeticA(uint x) public pure returns(uint) {
// The following fragment of code is a for-loop that assigns a value
View ifihardforked.md

If I hardforked: a doxxing of Satoshi Nakamoto

By Andrew Miller

If I hardforked would he mine it. Would he mine it if I forked it. 
Would he mine it would Satoshi would Satoshi would would he mine it. 
If Satoshi if I hardforked if I hardforked if Satoshi. 
Would he mine it if I forked it if I hardforked if Satoshi. 
Would he mine it if Satoshi if Satoshi if I softforked. 
If I hardforked if Satoshi if Satoshi if I softforked.