Skip to content

Instantly share code, notes, and snippets.

View SCBuergel's full-sized avatar

Sebastian C. Bürgel SCBuergel

  • HOPR
  • utterly insignificant little blue green planet orbiting a small unregarded yellow sun, far out in the uncharted backwaters of the unfashionable end of the western spiral arm of the Galaxy
  • X @SCBuergel
View GitHub Profile
@SCBuergel
SCBuergel / latrpc.pi
Created November 23, 2023 22:02
Ethereum RPC latency measurement in python
import time
import requests
import json
import statistics
# Ethereum RPC URL (Replace with the URL of the RPC provider you want to measure)
rpc_url = "YOUR_ETHEREUM_RPC_URL"
# JSON RPC request payload to get chain ID
payload = {
@SCBuergel
SCBuergel / MyToken.sol
Created October 6, 2022 18:28
ERC20 example implementations
// SPDX-License-Identifier: MIT
pragma solidity ^0.8;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.3/contracts/token/ERC20/ERC20.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.3/contracts/access/Ownable.sol";
contract OZtoken is ERC20, Ownable {
constructor() ERC20("OZ Token", "OZT") {
_mint(msg.sender, 1e18);
const { ethers } = require("ethers");
const url =
// 'https://rpc-mainnet.matic.network' // seems rate limited
// 'https://matic-mainnet.chainstacklabs.com' // flaky AF
// 'https://rpc-mainnet.maticvigil.com' // seems rate limited
'https://rpc-mainnet.matic.quiknode.pro'
// 'https://matic-mainnet-full-rpc.bwarelabs.com'
// 'https://matic-mainnet-archive-rpc.bwarelabs.com' // slow AF
@SCBuergel
SCBuergel / KeybaseProof.txt
Created July 8, 2020 10:35
Keybase Proof
### Keybase proof
I hereby claim:
* I am scbuergel on github.
* I am scbuergel (https://keybase.io/scbuergel) on keybase.
* I have a public key ASDPW_gergvOV6iwytveoveRZ-NbIQwznkKag5bVe7HImwo
To claim this, I am signing this object:
@SCBuergel
SCBuergel / PatentRegistry.sol
Created February 11, 2018 11:51
Simple patent registry on the Ethereum blockchain written in Solidity
pragma solidity ^0.4.18;
import "github.com/OpenZeppelin/zeppelin-solidity/contracts/ownership/Ownable.sol";
contract PatentRegistry is Ownable {
struct Patent {
string[] claims;
address inventor;
uint256 filingTime;
@SCBuergel
SCBuergel / AccessManager.sol
Created December 17, 2017 15:37
example of a minimal function-level access manager
pragma solidity ^0.4.17;
contract AccessManager {
// @TODO: make Ownable
mapping(address => mapping(bytes4 => bool)) public accessStore;
modifier hasAccess(address acc, bytes data) {
bytes4 functionId;
0x639A1dc3062444B30b7CA6A5E6e41090C3bCA13A
0x74aBBDC4E5D62210194f503A871A6bf68744B1a1
@SCBuergel
SCBuergel / gist:62ba70444e5715d9c6c699adc8ee91f3
Created March 13, 2017 22:15
eris chains logs sonectchain
INFO[03-13|21:59:31] Server stop event fired. Good bye. module=eris/server
INFO[03-13|21:59:38] Starting EventSwitch module=events impl=EventSwitch
NOTE[03-13|21:59:38] Loaded PrivValidator module=types file=/home/eris/.eris/chains/sonectchain/priv_validator.json privValidator="PrivValidator{2CEB44E9033DF98E1085D81A5748DAC3BA603FFB LH:1, LR:0, LS:2}"
Force disabling Tendermint's native RPC, which had been set to run on '0.0.0.0:46657' in the Tendermint config.
INFO[03-13|21:59:38] Starting EventSwitch module=events impl=EventSwitch
DBUG[03-13|21:59:38] addRound(round) module=consensus round=0
INFO[03-13|21:59:38] Local listener module=p2p ip=:: port=46656
INFO[03-13|21:59:38] Getting UPNP external address module=p2p
INFO[03-13|21:59:41] Could not perform UPNP discover module=p2p error="write udp4 0.0.0.0:47286->239.255.255.250:1900: i/o timeout"
INFO[03-13|21:59:41] Starting
root@VL-ZE:~# geth --nodiscover --maxpeers 0 --datadir "./chainData" --targetgaslimit "123123123" --mine --minerthreads=1 --rpc --rpcapi "eth,net,web3,personal" --rpccorsdomain "*" --rpcaddr "0.0.0.0" --unlock 0xddba7cdc7601cf0b5f11de7cb8aaee66320e2972 --password /dev/null
I0201 20:31:03.099412 ethdb/database.go:83] Allotted 128MB cache and 1024 file handles to /root/chainData/geth/chaindata
I0201 20:31:03.130286 ethdb/database.go:176] closed db:/root/chainData/geth/chaindata
I0201 20:31:03.131035 node/node.go:176] instance: Geth/v1.5.5-unstable-e4e8d6a0/linux/go1.7
I0201 20:31:03.131204 ethdb/database.go:83] Allotted 128MB cache and 1024 file handles to /root/chainData/geth/chaindata
I0201 20:31:03.224323 eth/backend.go:189] Protocol Versions: [63 62], Network Id: 1
I0201 20:31:03.224985 eth/backend.go:217] Chain config: {ChainID: 0 Homestead: <nil> DAO: <nil> DAOSupport: false EIP150: <nil> EIP155: <nil> EIP158: <nil>}
I0201 20:31:03.227369 core/blockchain.go:219] Last header: #1169999 [bd80d594…] TD=191692