Skip to content

Instantly share code, notes, and snippets.

View kidwai's full-sized avatar

Mohammad Kidwai kidwai

  • Toronto, Ontario
View GitHub Profile
pragma solidity ^0.4.18;
contract CharityChallenge {
address public charity;
// Milestones correspond to notable levels of funds raised,
// in terms the number of meals afforded for the 96 homeless
// youths (at ~ $3/meal and $700/eth)
0x7243366ae3a8F4Fd4Da9878183ee94E7A2611FA0
@kidwai
kidwai / rink
Last active October 12, 2017 00:20
0x96Ed164e6F3A514402af32Ac5Cbb3e28602014a8
@kidwai
kidwai / setup.sh
Created October 1, 2017 02:09
A setup script for a fresh installation of Ubuntu 16.04 LTS.
#!/bin/bash
# Run with sudo
if [ ! `whoami` = 'root' ]; then
echo 'you must be root to run setup'
exit
fi
### ESSENTIALS IMO ###
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@kidwai
kidwai / automine.js
Last active December 5, 2017 06:12
scripts to set up a dank autominer with geth instead of testrpc
function automine (n) {
var n = n || 5;
setInterval(function () {
if (!eth.mining && (txpool.status.pending || txpool.status.queued)) {
console.log("miner start");
miner.start();
}
else if (eth.mining) {
console.log('miner stop');
miner.stop();
@kidwai
kidwai / TokenLib.sol
Created September 14, 2017 17:02
A rough sketch of a token library. There are probably problems.
/**
* A simple example of a token sale that makes use of a library with
* a simple transfer function and a token struct. This is a biased implementation
* that mimics the types of operations found in most current token implementations.
* The purpose is only to illustrate the idea. This is nothing novel and turns out
* to be very similar to work by Open Zeppelin (https://blog.aragon.one/library-driven-development-in-solidity-2bebcaf88736).
*
* This can be generalized to support multiple sales or auctions. Questions surrounding issuance
* structure and governance are imperative, no different from ERC20 tokens.
*
@kidwai
kidwai / DeathWallet.sol
Last active September 13, 2017 04:08
A wallet whose owner can be changed after a fixed period of absence.
pragma solidity ^0.4.11;
// A contract with an owner property
contract Ownable {
address public owner;
modifier onlyOwner {
require(msg.sender == owner);
_;
@kidwai
kidwai / faucet
Created September 13, 2017 02:17
0x14723a09acff6d2a60dcdf7aa4aff308fddc160c
@kidwai
kidwai / rink
Created September 11, 2017 17:41
0x10212dc0f48a903b8446fa3784b461130eff617f