Skip to content

Instantly share code, notes, and snippets.

View sambacha's full-sized avatar
:atom:

sam bacha sambacha

:atom:
View GitHub Profile
@sambacha
sambacha / web_authn_pem_to_keystore.sh
Created May 31, 2025 17:21
web authn private key to keystore format
#!usr/bin/env bash
# !ACHTUNG: Use at your own risk, AI slop generated
# You can export web authn private key using devtools web authn thingy
# Play stupid games, win retarded prizes
# Avoid contact with eyes, apply directly to forehead
#
PEM_FILE="private_key.pem"
KEYSTORE_NAME="my_eth_wallet"
#!/bin/sh
n=$1
shift
for i in $(seq $n); do
"$@" || exit 1
done
@sambacha
sambacha / 60000000.json
Created May 29, 2025 22:00
60000000 gas
{
"fee_recipient": "0x4675C7e5BaAFBFFbca748158bEcBA61ef3b0a263",
"gas_limit": "60000000",
"timestamp": "1747259492",
"pubkey": "0x8cc78da09b1dc434f0609b05461eb9031cd3f38dd30dd65fbf036a593922cadaba9dfd8a94e0c29b33cc65a70b605e52"
}
def is_one_confirmed(store, block_root) -> bool:
"""
Same logic as in the Confirmation Rule PR
"""
pass
def get_checkpoint_weight(store, checkpoint, checkpoint_state) -> Gwei:
"""
Uses LMD-GHOST votes to estimate FFG support for a checkpoint.
/* @source {@link https://piccalil.li/blog/a-more-modern-css-reset/}
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Prevent font size inflation */
html {

Mathematical Formalization of Prize-Linked Savings Accounts

1. Notation and Definitions

  • t: Time period (can be discrete, e.g., days, weeks, or continuous)
  • u: Index for user, u = 1, 2, ..., N, where N is the number of users
  • V(t): Total value of assets deposited in the underlying ERC-4626 Vault at time t
  • D_u(t): Deposit amount of user u at time t. We assume deposits are cumulative, so D_u(t) represents the total deposited amount by user u up to time t
  • S_u(t): Vault Shares (ERC-4626 tokens) held by user u at time t
TopLevelObject = 'object' '{' Code? ( Object | Data )* '}'
Object = 'object' StringLiteral '{' Code? ( Object | Data )* '}'
Code = 'code' Block
Data = 'data' StringLiteral HexLiteral
HexLiteral = 'hex' ('"' ([0-9a-fA-F]{2})* '"' | '\'' ([0-9a-fA-F]{2})* '\'')
StringLiteral = '"' ([^"\r\n\\] | '\\' .)* '"'
@sambacha
sambacha / main.go
Created February 24, 2025 04:34 — forked from mdehoog/main.go
Dump the transcation size + estimated compressed size from a geth database, and analyze using numpy
package main
import (
"bytes"
"compress/zlib"
"context"
"encoding/binary"
"fmt"
"log"
"math/big"
@sambacha
sambacha / tarun_airdrop_option.py
Created February 21, 2025 20:58
Chitra Airdrop Python script
import argparse
import numpy as np
from scipy.optimize import fsolve
def payoff(Pt, C, tau_s, r):
"""Calculates the payoff of the airdrop for a single user.
Args:
Pt: Asset price at time t.
C: Capital committed by the user at time tau_s.
bun create @knip/config
bun add --dev --exact @biomejs/biome
npm install --save-dev --save-exact @biomejs/biome
npm init @knip/config
npm install -D knip typescript @types/node
npx knip
knip --fix