Skip to content

Instantly share code, notes, and snippets.

View veox's full-sized avatar
💭
Being skeptical of status feature.

Noel Maersk veox

💭
Being skeptical of status feature.
View GitHub Profile
contract SplitFunds {
function split(address[] addrs){
if(!addrs[uint(block.blockhash(block.number-1)) % addrs.length].send(msg.value)) throw;
}
}
```
// This code snippet shows how an external function can use a pattern like
// python's `try..except..else` with `.call`, `throw`, and reentry
contract TryExceptElsePatternUser {
address _sender;
function tryExceptElsePatternExample()
external // must be external
{
if( msg.sender == address(this) ) {

.eth Registrar using only Deposits.md

This is an attempt of setting up a name registrar that use deposits instead of burning or token contributions and tries to optimize name utility and reduce domain squatting. Previous initiatives of charging a "rent" based on the market price with an yearly auction proved impopular with many developers as they believed the registrar wasn't delivering any value for the "tax" as well as worries that a sudden big auction could force someone unexpectedly to be forced to sell the name.

In order to start doing that let's define the problem:

Name squatting is defined as buying a name and not adding any value to it, just holding it expecting that domains names will become more valuable in the future. Let's assume that all name buyers have the intention of acquiring a name and make it more valuable over time, either by working on it as a business and adding value to the "brand", or by working to increase the chances of finding a

/**
* Author: Nick Johnson <arachnid at notdot.net>
*
* WARNING: This contract is new and thus-far only lightly tested. I'm fairly
* confident it operates as described, but you may want to assure yourself of
* its correctness - or wait for others to do so for you - before you trust your
* ether to it. No guarantees, express or implied, are provided - use at your
* own risk.
*
* @dev Ether vault contract. Stores ether with a 'time lock' on withdrawals,
@D-Nice
D-Nice / DatePayout.sol
Last active November 28, 2016 11:44
Contract for locking a certain amount of ether until a set date
contract DateTime {
/*
* Credit to pipermerriam for this utility contract
*
* Date and Time utilities for ethereum contracts
*
* address: 0x1a6184cd4c5bea62b0116de7962ee7315b7bcbce
*/
function toTimestamp(uint16 year, uint8 month, uint8 day) constant returns (uint timestamp);
library LZF {
function decompress(bytes memory compressed, bytes memory decompressed) internal {
uint ip;
uint in_end;
uint op;
assembly {
// OP points to the current output location in memory
op := add(decompressed, 32)
// IP actually points to 31 bytes before the desired location, so
// MLOADs work correctly
@pdaian
pdaian / ethereum_graphs.py
Created February 13, 2017 19:12
Ethereum Fork Market Data Graphing Script
import datetime, requests
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import json, collections, os
UTC_OFFSET = -14400 # Local offset from UTC
START_DATE = "2016-01-01" # Day to start chat
TMP_DIR = "/tmp" # Writable temp directory, without trailing slash
@randyklein
randyklein / config.py
Last active March 4, 2022 08:20
Simple NiceHash Monitor
#config
minProf= .001 #min profit for alert in BTC/Day
slowAlertTimer = 300 #min time for slow alert in seconds
offTimer = 0 #min time of off alert in seconds
btcAddress = "address goes here" #niceHash BTC address to monitor
iftttKey = "key goes here" #key from IFTTT Maker applet
@alexvandesande
alexvandesande / ethernalsale.js
Last active October 21, 2021 04:40
This is a first draft at what could be a continuous token sale. I just wrote it and haven't tested it but it shows the proof of concept: tokens are continuously generated in any curve desired and sold for the highest bidder. Since there's a maximum token sale speed, this guarantees that sales can't end too quickly. Since the sale always starts f…
pragma solidity ^0.4.2;
contract ethernalSale {
struct order {
uint amount;
address buyer;
}
mapping (uint => order) orderBook;
mapping (address => uint) balanceOf;

EC2 settings

  • Instance type: t2.xlarge
  • vCPUs: 4
  • Memory (GiB): 16
  • General Purpose SSD (GP2): 200 GB
  • Ubuntu
  • Running in eu-central-1b (Frankfurt)

Hint: to make your life easier and allow login with a simple ssh btc-0.14, edit ~/.ssh/config: