Skip to content

Instantly share code, notes, and snippets.

View DanielVF's full-sized avatar

Daniel Von Fange DanielVF

View GitHub Profile
library PStore {
function pload(uint256 memoryStart, uint256 slotStart, uint256 slotCount) internal view {
assembly {
function run(memoryEnd, slot, memoryCursor) {
for {} xor(memoryCursor, memoryEnd) {} {
mstore(memoryCursor, sload(slot))
// memoryCursor is already at the top.
memoryCursor := add(memoryCursor, 0x20)

Gas pricing

Here’s a chart I made of the marginal cost for one million gas on Ethereum since base fees were introduced. Log10-scaled.

The quantized steps are a brilliant hack. Nice work!

The primary effect of this EIP is to allow computation/communication gas to become cheaper in dollar terms and as a result unlocking more applications that are both storage-light and infeasible at current gas prices.

#!/usr/bin/env python3
"""
dedup.py — Deduplicate files across one or more directories.
Usage:
python dedup.py [--dry-run] <dir1> [dir2] ...
Duplicate files (same length + same SHA-256) are moved into a DUPLICATE/
subfolder inside their original parent directory. The "best" copy (shortest
filename, then shortest directory path, then alphabetical full path) is kept
@DanielVF
DanielVF / GptBugReport.md
Last active September 6, 2025 19:00
Transcript, bad AI generated smart contract vulnerabilities.
@DanielVF
DanielVF / EulerSwap Printable.pdf
Last active June 2, 2025 17:09
EulerSwap Codebase
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@DanielVF
DanielVF / sample.md
Last active May 16, 2025 19:03
Sample Vulnerability Report

Impact

CRITICAL! Almost all USDC liquidity on the REKT/USDC uniswap pool can be stolen, due to an authorization issue with burnFrom() on the REKT token.

Background

Uniswap v2 pools get the prices for their swaps by comparing the relative amounts of each of the two tokens that they hold. If the pool holds very little of token A, and a lot of token B, then it only takes a little of token A to buy a lot of token B.

Currently REKT and USDC are fairly priced in the pool. If there were to suddenly be very little REKT in the pool, but the same amount of USDC, then very little REKT would be able to buy a lot of USDC.

@DanielVF
DanielVF / amm_strat_report.ipynb
Created September 11, 2023 13:50
Balancer Reth Eth
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@DanielVF
DanielVF / amo_balancing.ipynb
Last active September 7, 2023 12:34
AMO Balancing Fork Tests
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@DanielVF
DanielVF / Current Curve Earnings .ipynb
Created August 9, 2023 18:38
Get ETH Earned from Curve Rewards
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@DanielVF
DanielVF / compare_live.fish
Created June 27, 2023 14:03
Compare deployed contracts to version in local repo
#!/opt/homebrew/bin/fish
# Usage:
# ./compare_live.fish CONTRACT_ADDRESS
# Config
set SRC_DIR /PATH/TO/REPO/CONTRACTS
set OZ_DIR $SRC_DIR/node_modules
# Download