Skip to content

Instantly share code, notes, and snippets.

View Dustin4444's full-sized avatar

Dustin Dustin4444

View GitHub Profile
// actual representation of snow in Brighton - dirty code, but small :)
// run in your console
a=document.createElement("b");document.body.appendChild(a);with(a.style){position="fixed";left=top=0;height=width="100%";background="#fff"};
// actual representation of snow in Brighton - dirty code, but small :)
// run in your console
a=document.createElement("b");document.body.appendChild(a);with(a.style){position="fixed";left=top=0;height=width="100%";background="#fff"};
@Dustin4444
Dustin4444 / eth2_ws_calc.py
Created April 21, 2025 00:26 — forked from adiasg/eth2_ws_calc.py
Eth2 Weak Subjectivity Period Calculation
"""
This script calculates the Eth2 Weak Subjectivity period as defined by eth2.0-specs: https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/weak-subjectivity.md
"""
from eth2spec.phase0.mainnet import (
uint64, Ether,
ETH_TO_GWEI,
MAX_DEPOSITS,
MAX_EFFECTIVE_BALANCE,
SLOTS_PER_EPOCH,
gc 1 @0.076s 0%: 0.028+3.0+0.012 ms clock, 0.92+0/5.2/0.16+0.39 ms cpu, 20->20->8 MB, 20 MB goal, 0 MB stacks, 0 MB globals, 32 P
gc 2 @0.267s 0%: 0.044+13+0.010 ms clock, 1.4+2.5/17/0.18+0.32 ms cpu, 60->60->24 MB, 60 MB goal, 0 MB stacks, 0 MB globals, 32 P
gc 3 @0.442s 0%: 0.036+17+0.012 ms clock, 1.1+0.17/26/4.3+0.38 ms cpu, 168->168->66 MB, 168 MB goal, 0 MB stacks, 0 MB globals, 32 P
gc 4 @0.757s 0%: 0.033+7.2+0.037 ms clock, 1.0+0/52/62+1.1 ms cpu, 474->474->272 MB, 474 MB goal, 0 MB stacks, 0 MB globals, 32 P
gc 5 @5.640s 0%: 0.071+18+0.013 ms clock, 2.2+0.12/89/203+0.42 ms cpu, 1636->1637->339 MB, 1642 MB goal, 0 MB stacks, 0 MB globals, 32 P
gc 6 @9.452s 0%: 0.12+13+0.029 ms clock, 3.9+2.1/103/256+0.93 ms cpu, 2038->2043->585 MB, 2042 MB goal, 0 MB stacks, 0 MB globals, 32 P
gc 7 @15.878s 0%: 0.082+16+0.037 ms clock, 2.6+7.2/130/293+1.2 ms cpu, 3501->3502->731 MB, 3515 MB goal, 0 MB stacks, 0 MB globals, 32 P
gc 8 @24.665s 0%: 0.10+18+0.016 ms clock, 3.2+7.2/146/352+0.53 ms cpu, 4381->4383->751 MB,

FilterMaps data structure explanation

FilterMaps is a search structure that maps the log events of an Ethereum blockchain in a way that allows the implementation of pattern matchers with reasonable amount of data access. It is suitable both for the acceleration of local lookups and for generating reasonably sized trustless proofs for the complete set of results for a certain match pattern and block range. The latter assumes that the structure is tree hashed and the receiver of the proof knows the root hash of this tree. Note that the tree hashing scheme and the proof format are outside the scope of this document.

Linear log value index space

Log values are defined as the SHA2 hashes of log addresses and topics. FilterMaps maps all log values onto a linear index space as shown below:

Block number Transaction index Log index Log event Log value indices

FilterMaps data structure explanation

FilterMaps is a search structure that maps the log events of an Ethereum blockchain in a way that allows the implementation of pattern matchers with reasonable amount of data access. It is suitable both for the acceleration of local lookups and for generating reasonably sized trustless proofs for the complete set of results for a certain match pattern and block range. The latter assumes that the structure is tree hashed and the receiver of the proof knows the root hash of this tree. Note that the tree hashing scheme and the proof format are outside the scope of this document.

Linear log value index space

Log values are defined as the SHA2 hashes of log addresses and topics. FilterMaps maps all log values onto a linear index space as shown below:

Block number Transaction index Log index Log event Log value indices
@Dustin4444
Dustin4444 / token.md
Created May 9, 2025 22:30 — forked from jeffanthony/token.md
Token proposal

Token

Methods

totalSupply

function totalSupply() constant returns (uint256 supply)

Get the total coin supply

var settings = {
// Set to 'true' (without quotes) if run on Windows 64bit. Set to 'false' (without quotes) otherwise.
x64: true,
// Set to disk letter, where PhpStorm was installed to (e.g. C:)
disk_letter: 'C:',
// Set to folder name, where PhpStorm was installed to (e.g. 'PhpStorm')
folder_name: 'PhpStorm 2022.1.2',
@Dustin4444
Dustin4444 / .deps...npm...@openzeppelin...contracts...interfaces...draft-IERC6093.sol
Created June 5, 2025 13:41
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.30+commit.73712a01.js&optimize=false&runs=NaN&gist=
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard ERC-20 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.
*/
interface IERC20Errors {
/**
@Dustin4444
Dustin4444 / checksums.txt
Created June 15, 2025 01:36 — forked from lightclient/checksums.txt
Era1 Checksums
0x407c4c0eecd727ba70368bab3750043b722e00abb62c1bb44d4557d085fe2173
0x682b68a5a475069595d10b7f0350b628fb7f2500f6c16da429bd14318aab95a5
0x4791b876b930fe597810b09ab5d264e6510e7e88699a3cfb44419ba768a8cf39
0x84c0343f0cc617575fd4be216212cc47cda3b59c491d6ac69a09de248dfc53ad
0x7de0294942c5c2ad9a934c121c50b4d04840459134178a39d792fc89bd4e6bbb
0xab8129f9e23721e8aeebd2224cf7107df1bdc91f5892bb2082cfc31f29c1e599
0x8e6fd1531a5a6a42c8b4343ad88c906cd362ef9d509607cb80cbd6f95e5d15d9
0x84b0127f5973d67b7a3ffd444ae32d682208034c584d58898d3949aae17359c4
0x2689bdc1cf3e9827ee574bd543192ff5bf2b00f92569de805e9a1c6ce108e440
0x3c7cc83a771472f1e2720ef74361999b106fd2f4b5659cd689c3323e25a1eaa5