Skip to content

Instantly share code, notes, and snippets.

View cmditch's full-sized avatar
🥑

Coury Ditch cmditch

🥑
View GitHub Profile
@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-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 / 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
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",
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";
/// @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.
pragma solidity ^0.4.24;
// All of this is confirmed working within remix, and geth, but freezes up hevm.
// See here for testing with `hevm` and `dapp test`
/////////////////////////////
// Start of proxy contract
//

Keybase proof

I hereby claim:

  • I am cmditch on github.
  • I am cmditch (https://keybase.io/cmditch) on keybase.
  • I have a public key ASCHsJpdw1mQ73sqlouzmjDOog9WofX1KK6weSsYGQGniQo

To claim this, I am signing this object:

<?xml version="1.0" ?><svg enable-background="new 0 0 226.777 226.777" height="100px" id="Layer_1" version="1.1" viewBox="0 0 226.777 226.777" width="100px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g>
<polygon fill="#5A6378" points="112.553,157 112.553,86.977 44.158,116.937 "/>
<polygon fill="#7FD13B" points="112.553,82.163 112.553,-0.056 46.362,111.156 "/>
<polygon fill="#60B5CC" points="116.962,-0.09 116.962,82.163 184.083,111.566 "/>
<polygon fill="#F0AD00" points="116.962,86.977 116.962,157.002 185.405,116.957 "/>
<polygon fill="#60B5CC" points="112.553,227.406 112.553,171.085 44.618,131.31 "/>
<polygon fill="#7FD13B" points="116.962,227.406 184.897,131.31 116.962,171.085 "/></g></svg>
@cmditch
cmditch / cdffc94-build-error.txt
Created May 21, 2019 01:16
Error while building on macOS (hevm commit cdffc94)
Preprocessing library for hevm-0.30..
Building library for hevm-0.30..
clang-5.0: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
In file included from ethjet/ethjet-ff.cc:6:0: error:
In file included from /nix/store/k4im5gvnhivvinhaqnbynljlzjvavqka-libff-0.20181030/include/libff/algebra/fields/bigint.hpp:17:0: error:
In file included from /nix/store/k4im5gvnhivvinhaqnbynljlzjvavqka-libff-0.20181030/include/libff/common/serialization.hpp:104:0: error: