Skip to content

Instantly share code, notes, and snippets.

View cmditch's full-sized avatar
🥑

Coury Ditch cmditch

🥑
View GitHub Profile
pragma solidity ^0.4.24;
/// @title Proxy - Generic proxy contract allows to execute all transactions applying the code of a master contract.
/// @author Stefan George - <stefan@gnosis.pm>
// Mix this into contracts you'd like to be "proxyable",
// masterCopy must be the first var in any proxied contract in order to work correctly.
contract Proxyable {
address masterCopy;
}
pragma solidity ^0.4.24;
import "../lib/ds-test/src/test.sol";
// Proxy contract
/// @title Proxy - Generic proxy contract allows to execute all transactions applying the code of a master contract.
/// @author Stefan George - <stefan@gnosis.pm>
// Mix this into contracts you'd like to be "proxyable",
@cmditch
cmditch / Triggerd.elm
Created July 3, 2018 02:42
trigggrd evm bytecode decoder for list of list support
type EvmDecoder a
= EvmDecoder (Tape -> Result String ( Tape, a ))
type Tape
= Tape String String
@cmditch
cmditch / haskell-records.md
Created June 27, 2018 00:14 — forked from mtesseract/haskell-records.md
Working around Haskell's namespace problem for records

The Problem

Defining records in Haskell causes accessor functions for the record's fields to be defined. There is no seperate namespace for these accessor functions.

The Goal

Be able to

  • use records in Haskell, which share field names.
  • use lenses for accessing these fields
@cmditch
cmditch / Int.elm
Last active June 8, 2018 05:04
Signed Integer Decoding in Elm (Two's Complement)
module Int exposing (..)
import BigInt exposing (BigInt)
import String.Extra as StringExtra
-- Tests
-- test == True
test : Bool
@cmditch
cmditch / Haskell-Style-Guide.md
Created June 4, 2018 21:53 — forked from evancz/Haskell-Style-Guide.md
A style guide for Elm tools

Haskell Style Guide for Elm

Goal: a consistent style throughout all Elm projects that is easy to read and produces clean diffs to make debugging easier. This means valuing regularity and simplicity over cleverness.

Line Length

Keep it under 80 characters. Going over is not the end of the world, but consider refactoring before you decide a line really must be longer.

Variables

@cmditch
cmditch / ProxyFactory.sol
Created May 23, 2018 17:18 — forked from GNSPS/ProxyFactory.sol
Improved `delegatecall` proxy contract factory (Solidity) [v0.0.4]
/***
* Shoutouts:
*
* Bytecode origin https://www.reddit.com/r/ethereum/comments/6ic49q/any_assembly_programmers_willing_to_write_a/dj5ceuw/
* Modified version of Vitalik's https://www.reddit.com/r/ethereum/comments/6c1jui/delegatecall_forwarders_how_to_save_5098_on/
* Credits to Jorge Izquierdo (@izqui) for coming up with this design here: https://gist.github.com/izqui/7f904443e6d19c1ab52ec7f5ad46b3a8
* Credits to Stefan George (@Georgi87) for inspiration for many of the improvements from Gnosis Safe: https://github.com/gnosis/gnosis-safe-contracts
*
* This version has many improvements over the original @izqui's library like using REVERT instead of THROWing on failed calls.
* It also implements the awesome design pattern for initializing code as seen in Gnosis Safe Factory: https://github.com/gnosis/gnosis-safe-contracts/blob/master/contracts/ProxyFactory.sol
module Web3.Internal.Utils
exposing
( toAddress
, toHex
, isChecksumAddress
)
import Bool.Extra exposing (all)
import Char
import Keccak exposing (ethereum_keccak_256)
pragma solidity ^0.4.21;
//////////////////////////////
// //
// DSAuthority //
// //
//////////////////////////////
contract DSAuthority {
module EvmDecoder exposing (main)
import BigInt exposing (BigInt)
import Hex
import Html exposing (Html, text)
import Json.Decode as Decode exposing (Decoder)
import Result.Extra as Result
import String.Extra as String
import Regex