Skip to content

Instantly share code, notes, and snippets.

View charles-cooper's full-sized avatar

Charles Cooper charles-cooper

View GitHub Profile
@Philogy
Philogy / selector-master.py
Last active October 25, 2022 03:38
Minimal Constant OP Selector Switch Generator
# @license MIT
# @author Philogy <https://github.com/Philogy>
from eth_utils.abi import function_signature_to_4byte_selector
from eth_utils.crypto import keccak
from math import ceil, log2
import pyperclip
def find_reselector_nonce(selectors, mask):
@emilaxelsson
emilaxelsson / CompleteMatching.hs
Last active January 20, 2017 19:28
Compilation as a Typed EDSL-to-EDSL Transformation
s{-# LANGUAGE GADTs #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
-- A version of the code from <http://fun-discoveries.blogspot.se/2016/03/compilation-as-typed-edsl-to-edsl.html>
-- which avoids incomplete matching on `Val` and `Ref`.