Skip to content

Instantly share code, notes, and snippets.

View hrharder's full-sized avatar
📡

Henry hrharder

📡
View GitHub Profile
@hrharder
hrharder / generate_key.go
Created August 14, 2020 03:06
Sample of a Ethereum vanity wallet generator, written in go. Supports multiple go-routines for optimal generation efficiency.
package cmd
import (
"fmt"
"os"
"time"
"github.com/briandowns/spinner"
"github.com/ethereum/go-ethereum/accounts/keystore"
def is_on_twitter(name: str) -> bool:
if name is "henry":
return True
else:
raise Exception("no data")
# calculates eth total supply
# will need to be updated occasionally
print(112099256.41)
@hrharder
hrharder / README.md
Created January 10, 2020 00:25
Why only able to increase payout to stakers?

Question

Makes sense but this is interesting, didn't know this couldn't be lowered. Did the 0x team provided an explanation for that design?

Answer

So play this out in your head. You stake with a pool that says they will pay back 90% of fees to stakers, great, right? Right before the payout epoch ends, they lower that to 0% and you get nothing.

At best, that is mean and unfair. At worse, it is blatently malicious. In the current construction, if a pool is offering a 90% payout, they are only able to increase that value (remember: they do this by lowering the proportion kept by the pool operator) which only stands to benefit you and other stakers.

With this construction, stakers are always gauranteed to get at least the percentage advertized, and maybe more. It's quite brilliant.

@hrharder
hrharder / go-transaction.out
Last active December 13, 2019 20:40
The files `quote.json` and `transaction.json` are from a real trade through our current TS system. The outputted calldata from Go does not /quite/ match the TS output.
Transaction:
- TakerAmount: 1383768064255352000
- Signature: 1c2713d85e6c4b00534865d7ff814db4b5fb541fe4fe1f92433b6922428d071e4f7466d422d78cc6e844861ff823c7dc8bd60f24de0d171d37731678423052444d03
- Data: 9b44d5560000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000133421b911785cc00000000000000000000000000000000000000000000000000000000000000360000000000000000000000000533014661bfcaf6f0431b2e406dc6590f02ad61d0000000000000000000000008c9ce34862490e3553f7743f308c28b3714a9b0a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000533014661bfcaf6f0431b2e406dc6590f02ad61d0000000000000000000000000000000000000000000000000018708f40273000000000000000000000000000000000000000000000000000133421b911785cc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005df3f2546e23aae1c3a3c7fccdd9806b2a72489e4de20cc98437b3
{
"orders": [
{
"id": 288,
"quote_id": "1ca3926d-afb6-4166-b62f-be6b14fda198",
"side": "bid",
"pair": "ZRX/WETH",
"size": "80.0",
"price": "0.001644894343715",
"expiration": "1572636617",
[%gall-take /sys/rep/~paldev/hall/7]
/~zod/home/~2019.7.22..18.55.46..83a3/sys/vane/gall:<[1.449 3].[1.454 5]>
/~zod/home/~2019.7.22..18.55.46..83a3/sys/vane/gall:<[1.450 3].[1.454 5]>
/~zod/home/~2019.7.22..18.55.46..83a3/sys/vane/gall:<[1.451 3].[1.454 5]>
/~zod/home/~2019.7.22..18.55.46..83a3/sys/vane/gall:<[1.452 11].[1.452 44]>
/~zod/home/~2019.7.22..18.55.46..83a3/sys/vane/gall:<[1.452 19].[1.452 44]>
/~zod/home/~2019.7.22..18.55.46..83a3/sys/vane/gall:<[307 5].[431 7]>
/~zod/home/~2019.7.22..18.55.46..83a3/sys/vane/gall:<[308 5].[431 7]>
/~zod/home/~2019.7.22..18.55.46..83a3/sys/vane/gall:<[352 7].[372 63]>
/~zod/home/~2019.7.22..18.55.46..83a3/sys/vane/gall:<[353 7].[372 63]>
@hrharder
hrharder / genesis.json
Created September 18, 2019 01:39
Command used (after setting contract state through portal.kosu.io):
{
"genesis_time": "2019-09-18T01:38:38.000Z",
"chain_id": "kosu-test-1",
"validators": [
{
"address": "7B200FA381F099F43DC3D8C7D87078850E9BED85",
"pub_key": {
"type": "tendermint/PubKeyEd25519",
"value": "hkjhkjhkjhjhkjhkjhkhkjhkjhkjhkjhkjhjhjhjhjg="
},
@hrharder
hrharder / genesis.json
Last active August 29, 2019 20:28
Kosu internal test-network ("wormhole") ✨
{
"genesis_time": "2019-08-29T00:00:00.00Z",
"chain_id": "kosu-wormhole-6",
"consensus_params": {
"block": {
"max_bytes": "22020096",
"max_gas": "-1",
"time_iota_ms": "1000"
},
"evidence": {
@hrharder
hrharder / zaidan-dealer-client.md
Last active August 7, 2019 20:27
Documentation for the Zaidan dealer browser client.