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
@markblundeberg
markblundeberg / atomic-size-attack.md
Created February 16, 2018 05:14
Advisory: secret size attack on cross-chain hash lock smart contracts

Advisory: secret size attack on cross-chain hash lock smart contracts

Dr. Mark B Lundeberg, 2018 Feb 15 bitcoincash:qqy9myvyt7qffgye5a2mn2vn8ry95qm6asy40ptgx2

This security advisory notes a vulnerability in the common construction of cross-chain smart contracts (contracts between distinct cryptocurrencies) through hash locking. I focus on the primary use case in [atomic

@cburgdorf
cburgdorf / gist:1d4678f135dea129147c3627dd609c4e
Created May 10, 2019 08:43
rocksdb_vs_leveldb_against_single_peer
Supervisord config:
[program:trinity]
user=ubuntu
environment=HOME="/home/ubuntu"
command=/home/ubuntu/trinity/venv/bin/trinity track-perf --track-perf-interval 1 --track-perf-trinity-exec '/home/ubuntu/trinity/venv/bin/trinity' --track-perf-pre-exec-cmd 'cd /home/ubuntu/trinity && git checkout -' --track-perf-report-path '/home/ubuntu/trinity/performance_report.txt' --track-perf-target-block 20000 --track-perf-run-count 10 --track-perf-trinity-args='--disable-discovery --preferred-node="enode://9a1cda701a98a08065b950a87c20df7d076c7e2b11dfcd489a66efd8cbb9fb9894c7788461d6140cf0f312794098917e952f173c09bbbddf848b97afad962d61@40.118.145.245:30303" --max-peers 1'
autostart=false
autorestart=false
redirect_stderr=true
stdout_logfile=/var/log/supervisor/trinity.log
import logging
import multiprocessing
from multiprocessing.managers import (
BaseManager,
)
import tempfile
import time
import pytest
package main
import (
"context"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethclient"
)
var server = "http://localhost:8545"
var blockHash = "0xac8e95f7483f7131261bcc0a70873f8236c27444c940defc677f74f281220193"
@5chdn
5chdn / stureby.aleth.json
Last active December 3, 2018 21:51
Stureby PoW Testnet Configuration for Constantinople Transition
{
"sealEngine":"Ethash",
"params":{
"accountStartNonce":"0x00",
"maximumExtraDataSize":"0x20",
"homesteadForkBlock":"0x2710",
"daoHardforkBlock":"0x00",
"EIP150ForkBlock":"0x3a98",
"EIP158ForkBlock":"0x59d8",
"byzantiumForkBlock":"0x7530",
contract MazeHashFunction {
function generateRandomNumber(uint _treasureMap) view public returns (uint) {
bytes memory randomNumber = new bytes(32);
bytes memory treasureMapInBytes = toBytes(_treasureMap);
uint8 nextByteInTreasureMap = uint8(treasureMapInBytes[31]);
uint8 pointerToNextPosition = nextByteInTreasureMap;
for(uint i = 31; i >0; i--) {
uint nextHashInLabyrinth = uint(blockhash(block.number - 1 - pointerToNextPosition));
@jordanmack
jordanmack / user.js
Last active October 23, 2018 06:33
Peepeth Enhancer is a user script that adds several new features to Peepeth. To use this user script install you will need the Tampermonkey plugin. https://tampermonkey.net/
// ==UserScript==
// @name Peepeth Enhancer
// @namespace https://github.com/jordanmack/PeepethEnhancer
// @version 0.3.0
// @description Peepeth Enhancer is a collection of scripts that add several new features to Peepeth.
// @author Jordan Mack (jordanmack.info)
// @match https://peepeth.com/*
// @grant none
// ==/UserScript==
@holiman
holiman / result.md
Last active October 15, 2018 13:31

parity stateroot:0xa054d80c3c6192476447b6fdb3276af19400068432949c28431e5cc3e63d3c3f,, geth stateroot: 0x3ba0188e00002fd15395c3acca8cbbca76dbe56f5f2214d7fb12c1c348aaa965

{
"SstoreCallToSelfSubRefundBelowZero": {
"_info": {
"comment": "Test where accnt has slot 1 value of '2', is cleared, then calls itself and overwrites with '3', causing a refund-deduction in second call context",
"filledwith": "manaually filled by @holiman",
"lllcversion": "none",
"source": "none",
"sourceHash": "none"
},
"env": {
@jordanmack
jordanmack / gist:9373f9b922e906eeffb0cbff0cefe57e
Created August 25, 2018 04:51
Peepeth: Bookmarklet code to unhide all content without having to click.
javascript:(function()%7Bconst%20reveal%20%3D%20function()%7BjQuery(%22a.nsfwShow%22).click()%3BjQuery(%22a.politicsShow%22).click()%3B%7D%3Breveal()%3BsetInterval(reveal%2C%20500)%7D)()