Skip to content

Instantly share code, notes, and snippets.

View Arachnid's full-sized avatar

Nick Johnson Arachnid

View GitHub Profile
// 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;
// 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;
@Arachnid
Arachnid / ensTypes.graphql
Last active September 26, 2018 15:33 — forked from jefflau/ensTypes.graphql
ensTypes.graphql
type Address {
address: String
}
type Node {
name: String
nameHash: String
label: String
node: String
subNodes: [Node]
#import asyncio
import logging
from flask import Blueprint, Flask, request, render_template, g
from flask_graphql import GraphQLView
from google.cloud import logging as glogging
#from graphql.execution.executors.asyncio import AsyncioExecutor
from web3 import Web3, HTTPProvider
from werkzeug.serving import run_simple
from graphql import (
graphql,
object "Create2Proxy" {
code {
let size := datasize("runtime")
datacopy(0, dataoffset("runtime"), size)
return(0, size)
}
object "runtime" {
code {
let salt := calldataload(0)
let size := sub(calldatasize(), 32)
contract UserTokenFactory {
mapping(address=>UserToken) public userTokens;
function getUserToken(address owner) returns(UserToken) {
if(userTokens[owner] == 0) {
UserToken token = new UserToken(owner);
userTokens[owner] = token;
}
return userTokens[owner];
}
object "Create2Proxy" {
code {
let size := datasize("runtime")
datacopy(0, dataoffset("runtime"), size)
return(0, size)
}
object "runtime" {
code {
let salt := calldataload(0)
let size := sub(calldatasize(), 32)
https://etherscan.io/address/0x285088c75a8508664ad77df63e2d60a408e5284a
https://etherscan.io/address/0x911143d946ba5d467bfc476491fdb235fef4d667
pragma solidity ^0.5.0;
import './ENS.sol';
library BytesUtils {
/*
* @dev Returns the 32 byte value at the specified index of self.
* @param self The byte string.
* @param idx The index into the bytes
* @return The specified 32 bytes of the string.
contract Registrar is Owned {
ENS public ens;
mapping(address=>boolean) public controllers;
constructor(ENS _ens) public {
ens = _ens;
setController(msg.sender, true);
}
function setController(address controller, boolean isController) ownerOnly {