Skip to content

Instantly share code, notes, and snippets.

@carver
carver / trinity.log
Last active April 20, 2020 23:01
Trinity hanging on Ctrl-C shutdown. Requires two pkill -2 calls to kill it completely.
INFO 2020-04-20 15:48:44,450 trinity
______ _ _ __
/_ __/____(_)___ (_) /___ __
/ / / ___/ / __ \/ / __/ / / /
/ / / / / / / / / / /_/ /_/ /
/_/ /_/ /_/_/ /_/_/\__/\__, /
/____/
INFO 2020-04-20 15:48:44,450 trinity Started main process (pid=3970)
INFO 2020-04-20 15:48:44,451 trinity Trinity/v0.1.0a35/linux/cpython3.6.9
INFO 2020-04-20 15:48:44,451 trinity Trinity DEBUG log file is created at /home/jcarver/.local/share/trinity-beam/logs-eth1/trinity.log
@carver
carver / test_witness.py
Last active April 8, 2020 23:45
Starting an implementation of Ethereum witness format, at https://github.com/ethereum/stateless-ethereum-specs/blob/master/witness.md
from abc import ABC, abstractmethod
from enum import Enum
from typing import (
Iterable,
Tuple,
)
import cbor
from eth_typing import Hash32
from eth_utils import (
@carver
carver / README.md
Last active April 15, 2019 22:37
Ethereum Mainnet Witnesses

Below are witnesses needed to run mainnet blocks. They have everything you need to execute the transactions and generate the next state root.

The keys and values are hex encoded. To load them into a trinity database, you can use something like:

$ trinity <your launch config> db-shell
>>> with open('block7436790.witness') as f:
 hexnodes = [l.strip().split(':') for l in f.readlines()]
@carver
carver / py37_install.sh
Created October 28, 2018 09:55
Installing Python 3.7 from source
# roughly
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz
tar xf Python-3*
cd Python-3*
./configure
make
make altinstall
@carver
carver / UnsafeERC20.sol
Last active October 31, 2018 12:46
Unsafe ERC20 Example for Web3.py Workshop
pragma solidity ^0.4.25;
// This contract is an example, not to be used in production
// One example issue is that there are potential overflow/underflow bugs.
contract UnsafeERC20 {
mapping (address => uint256) private _balances;
uint256 private _totalSupply;

Keybase proof

I hereby claim:

  • I am carver on github.
  • I am jasoncarver (https://keybase.io/jasoncarver) on keybase.
  • I have a public key whose fingerprint is D1AA B317 6243 B1F5 215D C489 1243 D8E2 CFF0 5F92

To claim this, I am signing this object:

@carver
carver / DeedVault.sol
Last active August 17, 2017 20:05
Instaclaim: exploring an attack on DeedVault
pragma solidity ^0.4.15;
contract ENS {
function setSubnodeOwner(bytes32 node, bytes32 label, address owner);
function owner(bytes32 node) constant returns (address);
}
contract Deed {
address public owner;
address public previousOwner;
@carver
carver / gist:9a0f2d0ca3c5dc2ab6dd
Created August 10, 2014 21:26
onename.io verify
Verifying myself: My Bitcoin username is +carver. https://onename.io/carver