Skip to content

Instantly share code, notes, and snippets.

View joeykrug's full-sized avatar
🎯
Focusing

Joseph Krug joeykrug

🎯
Focusing
View GitHub Profile
MacBook-Pro:tmp joeykrug2$ geth upgradedb
Welcome to the FRONTIER
Upgrade blockchain DB
I0420 13:20:05.857311 24401 backend.go:186] Protocol Version: 60, Network Id: 0
I0420 13:20:05.857337 24401 backend.go:196] Blockchain DB Version: 2
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x40bc0ca]
goroutine 1 [running]:
github.com/ethereum/go-ethereum/core/types.(*Block).Hash(0x0, 0x0, 0x0, 0x0, 0x0)
@joeykrug
joeykrug / gist:c1311718815ca54fb650
Created April 26, 2015 19:49
Geth malloc error
I0426 03:37:19.386370 57643 chain_manager.go:609] imported 1 block(s) 0 queued in 17.061695ms. #180000 [43562e3b / 43562e3b]
I0426 03:37:19.388839 57643 worker.go:324] commit new work on block 180001 with 0 txs & 0 uncles
geth(57643,0xb0622000) malloc: *** error for object 0xc28e974008: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
SIGABRT: abort
PC=0x7fff8d06b286
signal arrived during cgo execution
goroutine 45825 [syscall, locked to thread]:
runtime.cgocall_errno(0x4004a30, 0xc20e32e330, 0x0)
my mom wanted to mine some of the .5eth block reward blocks, so i team viewed into her computer & installed alethzero, made her a fresh account, and let it start downloading blocks --- haven't mined anything yet, but she has 2048.9 finney
extremely weird --- decided to try to send a tx to my computer for a few hundred finney:
i 20:12:01|main New transaction ee56e0fd…{[CREATE]/0$47+21000@10000000000000<-b291451f… #0}
X 20:12:01|eth Sending from non-existant account. How did it pay!?!
i 20:12:01|eth #ee56e0fd… Dropping invalid transaction: State.cpp(977): Throw in function void __thiscall dev::eth::State::subBalance(class dev::FixedHash<20>,class boost::multiprecision::number<struct boost::multiprecision::backends::cpp_int_backend<0,0,1,0,class std::allocator<unsigned long> >,1>)
Dynamic exception type: class boost::exception_detail::clone_impl<struct dev::eth::NotEnoughCash>
std::exception::what: Unknown exception
# key is a voter address
data Voter[](weight, voted, delegatedTo, vote)
# key is a bill id
data Bill[](number, congress, billType, yesCount, noCount, chairperson)
macro TRUE: 1
# Error -1: bill already exists
def newBallot(number, congress, billType):
@joeykrug
joeykrug / test.py
Created June 20, 2016 20:02
Serpent test exploit
from ethereum import tester as t
code1 = '''
data banana
event log_price(market:indexed)
def init():
self.banana = 5
def getBanana():
return(self.banana)
@joeykrug
joeykrug / chrissend.py
Created June 20, 2016 20:16
Send log issue
from ethereum import tester as t
import serpent
code1 = '''\
event log_gas(gas:indexed)
def any():
log(type=log_gas, msg.gas)
send(0, msg.sender, msg.value)'''
@joeykrug
joeykrug / repContract.se
Created June 23, 2016 18:51
Rep contract
# Storage of all data associated with reporters
# takes reporterID as key, value is rep amount
data reporting[]
# keeps track of total rep in the system
data totalRep
# sender/owner, then spender, e.g. approvedToSpend[owner][spender]
# 1 if spender is approved, 0 if not
data approvedToSpend[][]
# This software (Augur) allows buying && selling event outcomes in ethereum
# Copyright (C) 2015 Forecast Foundation OU
# This program is free software; you can redistribute it &&/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is free software: you can redistribute it &&/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
@joeykrug
joeykrug / rep.se
Created August 8, 2016 20:48
Rep contract
# This software (Augur) allows buying && selling event outcomes in ethereum
# Copyright (C) 2015 Forecast Foundation OU
# This program is free software; you can redistribute it &&/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is free software: you can redistribute it &&/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
@joeykrug
joeykrug / float.se
Created November 22, 2016 20:47
float
type float: [a, b, c]
macro float($x) + float($y):
if(!safeToAdd($x, $y)):
throw()
float($x + $y)
macro float($x) - float($y):
if(!safeToSubtract($x, $y)):
throw()