Skip to content

Instantly share code, notes, and snippets.

contract MyContract {
DaiContract dai = 0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359;
function foo(uint amt) public {
require(dai.balanceOf(msg.sender) >= amt && dai.allowance(msg.sender, address(this)) >= amt);
require(dai.transferFrom(msg.sender, address(this), amt));
...
}
}
@seanwbren
seanwbren / dai.sh
Created August 22, 2018 17:21
Deploying Dai step 1
curl https://dapp.tools/install | sh
#!/usr/bin/env bash
## This script is invoked like
##
## $ with-deployed-system node index.js
##
## which will run Node in the environment of a running Geth testnet
## with the Sai system deployed.
##
## The environment has ETH_RPC_URL set along with the contract addresses.
##
@seanwbren
seanwbren / kovan
Created October 17, 2017 05:20
kovan
0x9EA5b6dF9f6A4684308D14CF4D2580D63DD4814A
@seanwbren
seanwbren / app.js
Created October 14, 2017 14:21
0x tutorial gist
const Web3 = require('web3');
const ZeroEx = require('0x.js').ZeroEx;
const BigNumber = require('bignumber.js');
// Default provider for TestRPC
const provider = new Web3.providers.HttpProvider('http://localhost:8545')
// Instantiate 0x.js instance
const zeroEx = new ZeroEx(provider);
@seanwbren
seanwbren / app.js
Created October 14, 2017 14:20
0x tutorial
const Web3 = require('web3');
const ZeroEx = require('0x.js').ZeroEx;
const BigNumber = require('bignumber.js');
// Default provider for TestRPC
const provider = new Web3.providers.HttpProvider('http://localhost:8545')
// Instantiate 0x.js instance
const zeroEx = new ZeroEx(provider);
0xB26A3609acD791e2eA3f1900619C910B45705adD
0x0cb27e883E207905AD2A94F9B6eF0C7A99223C37
@seanwbren
seanwbren / keybase.md
Created February 14, 2017 03:50
keybase proof

Keybase proof

I hereby claim:

  • I am sbberk on github.
  • I am seanwbren (https://keybase.io/seanwbren) on keybase.
  • I have a public key whose fingerprint is CF42 B88A D2FF 284A 3011 4192 A11D 625E CE1A E585

To claim this, I am signing this object:

@seanwbren
seanwbren / inventory.py
Created January 27, 2016 23:53 — forked from duggan/inventory.py
Present Terraform tfstate data as an Ansible inventory
#!/usr/bin/env python
import sys
import os
import json
import argparse
import collections
__description__ = """Ansible Dynamic Inventory for Terraform."""
__epilog__ = """