Skip to content

Instantly share code, notes, and snippets.

3501606d13c6c0e1be391447784ca1b00f99df50
@ethers
ethers / gist:9719143
Created March 23, 2014 05:22
bank contract
41aa0998d43b30f98235f1c0d57dc814f42a3cb1
@ethers
ethers / .gitconfig
Last active August 29, 2015 14:00
git config
[alias]
bra = branch -a
ci = commit
co = checkout
df = diff
last = log -1 HEAD
l = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
lp = log -p --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
st = status
unstage = reset HEAD --
@ethers
ethers / gist:11234829
Created April 23, 2014 22:33
pyethtool mktx
pyethtool mktx 7 13 cd2a3d9f938e13cd947ec05abc7fe734df8dd826 ''
e1070d85e8d4a5100082271094cd2a3d9f938e13cd947ec05abc7fe734df8dd82680
@ethers
ethers / gist:5bb1d00a768abbfd8663
Created November 8, 2014 03:42
JS CallEcrecover2 trace
vm 0 Opcode: PUSH32 Gas: 364724
vm 21 Opcode: PUSH1 Gas: 364723
vm 18c547e4f7b0f325ad1e56f57e26c745b09a3e503d86e00e5255ff7f715d3d1c
vm 23 Opcode: MSTORE Gas: 364722
vm 00
vm 18c547e4f7b0f325ad1e56f57e26c745b09a3e503d86e00e5255ff7f715d3d1c
vm 24 Opcode: PUSH1 Gas: 364720
vm 26 Opcode: PUSH1 Gas: 364719
vm 1c
vm 28 Opcode: MSTORE Gas: 364718
@ethers
ethers / gist:fa0fbd3bd581b0d7dc23
Created November 11, 2014 22:12
callcodeToNameRegistrator0 trace
*** [ 10:46:12 | main ] callcodeToNameRegistrator0
=S= [ 10:46:12 | main ] Executing {095e7bae…/0$100000+1000000@1<-a94f5374… #0} on b9e077c09d54e88ba769606ff0d072d2fdfe998c2f79d9280d366b1260414f41
=S= [ 10:46:12 | main ] f8638001830f424094095e7baea6a6c7c4c2dfeb977efac326af552d87830186a0801ba0c37d58d1f44152846a781e8f5d4fe30689c786190598f3aaaea12c2af551a432a0573c2d36fed68dc3f0e9a479b1a48da834396e7316119cbff1d3f472a5e1be7c
EVM [ 10:46:12 | main ]
STACK
MEMORY
STORAGE
EVM [ 10:46:12 | main | 0 | 095e7baea6a6c7c4c2dfeb977efac326af552d87 | #0 | 0000 : PUSH32 | 999500 | -1 | 0x32 ]
EVM [ 10:46:12 | main ]
@ethers
ethers / gist:3d477b0f9edb7718e481
Created November 12, 2014 02:30
ABAcalls1 runs out of balance
opts.address.toString('hex')
"095e7baea6a6c7c4c2dfeb977efac326af552d87"
bignum.fromBuffer(opts.account.balance).toString()
"1000000000000000000"
depth
0
opts.address.toString('hex')
"945304eb96065b2a98b57a48a06ae28d285a71b5"
@ethers
ethers / gist:10f27a44c3ab5e2997a0
Created November 12, 2014 20:19
SSTORE logic
storageTrie.get(key, function(err, found) {
if (found || (!found && val.toString('hex') === '00')) {
gasLeft = gasLeft.add(100);
} else if (!found && val.toString('hex') !== '00') {
gasLeft = gasLeft.sub(100);
} else if (found && val.toString('hex') === '00') {
gasLeft = gasLeft.add(200);
}
if (val.toString('hex') === '00') {
@ethers
ethers / gist:5a225b566393c1823524
Created December 11, 2014 04:15
flipBytes Serpent
data byte[32]
def flipBytes(n):
numByte = 5
mask = 0xff
i = 0
while i < numByte:
b = n & mask
b /= 2^(i*8)
b *= 2^((numByte-i-1)*8)
@ethers
ethers / gist:8d771d0eb727439e59bb
Created December 11, 2014 04:17
python flipBytes
byte = range(32)
def flipBytes(n):
numByte = 32
mask = 0xff
i = 0
while i < numByte:
b = n & mask
b /= 2 ** (i*8)
b *= 2 ** ((numByte-i-1)*8)