Skip to content

Instantly share code, notes, and snippets.

Avatar

Nick Johnson Arachnid

View GitHub Profile
View DumbMultisig.sol
// WHATEVER YOU DO, DON'T USE THIS.
// This is a bit of demo code posted to illustrate a principle. It is unaudited,
// probably full of bugs, and definintely not production ready.
// https://twitter.com/nicksdjohnson/status/1041642345467404291
import "./DumbWallet.sol";
contract DumbMultisig {
struct MultisigConfig {
mapping(address=>bool) signatories;
View WalletDelegator.sol
// WHATEVER YOU DO, DON'T USE THIS.
// This is a bit of demo code posted to illustrate a principle. It is unaudited,
// probably full of bugs, and definintely not production ready.
// https://twitter.com/nicksdjohnson/status/1041642345467404291
import "./DumbWallet.sol";
contract WalletDelegator {
mapping(address=>uint) public nonces;
View DumbWallet.sol
// WHATEVER YOU DO, DON'T USE THIS.
// This is a bit of demo code posted to illustrate a principle. It is unaudited,
// probably full of bugs, and definintely not production ready.
// https://twitter.com/nicksdjohnson/status/1041642345467404291
contract DumbWallet {
mapping(address=>bool) public authorised;
event Authorised(address indexed target, bool value);
event Call(address indexed target, uint value);
View auctionprices.py
import logging
import json
import sys
import mapreduce
def mapper(key, value):
if value['event'] == 'AuctionStarted':
yield (value['args']['hash'], {'registered': value['args']['registrationDate']})
View OpcodeChecker.sol
/**
* @dev OpcodeChecker processes contract code to generate a bitmap of used opcodes.
*
* DO NOT USE: See the vulnerability identified by Recmo below. A patch will be provided soon.
*
* The generated bitmap can be used to enforce whitelisting and blacklisting on contract code.
* Bit n of the bitmap is set iff opcode n is used. For instance, the presence of the STOP opcode
* will result in bit 0 of the bitmap being set.
*
* A best-effort attempt is made to skip over unreachable data, but there may be false positives.
View rfccat.py
import argparse
import requests
import xml.etree.ElementTree as ET
from cStringIO import StringIO
from PyPDF2 import PdfFileReader, PdfFileWriter
parser = argparse.ArgumentParser(description='Build a PDF from a set of matching RFCs')
parser.add_argument('rfc', metavar='RFC', nargs='*')
View typos.go
// Copyright 2018 The go-ethereum Authors
// This file is part of go-ethereum.
//
// go-ethereum is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// go-ethereum is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
View gpotest.py
from web3 import Web3, HTTPProvider
web3 = Web3(HTTPProvider("http://localhost:8545"))
PERCENTILE = 0.6
NUMBLOCKS = 43200
# NUMBLOCKS = 1000
def getMinGasPrice(block):
minPrice = None
View globalplatform install on OSX 10.13.md
View keybase.md

Keybase proof

I hereby claim:

  • I am arachnid on github.
  • I am arachnid (https://keybase.io/arachnid) on keybase.
  • I have a public key whose fingerprint is 01D0 4A62 A925 E4E6 9297 0628 A9C0 6CE2 FF8B 0A48

To claim this, I am signing this object:

You can’t perform that action at this time.