Skip to content

Instantly share code, notes, and snippets.

View 0xOlias's full-sized avatar

typedarray 0xOlias

View GitHub Profile
@0xOlias
0xOlias / tiny-83-mint-helper.md
Last active November 2, 2021 00:26
TINY-83 mint helper
  1. Go to https://tiny-83.github.io/tiny-83
  2. Change the min and max fields as shown below:
xMin = 0
xMax = 22
yMin = -1
yMax = 14
  1. Copy this code, type 1 where you want to draw a pixel, then paste the result into the y = text field on the website.
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.13;
import {Poke} from "src/Poke.sol";
import {EthPlaysAuction} from "src/EthPlaysAuction.sol";
contract Deploy {
Poke poke;
EthPlaysAuction ethPlaysAuction;
@0xOlias
0xOlias / trace-ordering.md
Last active April 2, 2024 17:14
EVM trace ordering

Design a scheme for ordering EVM trace objects according to their execution within a transaction.

Requirements

  • The key requirement is that you don't have all the traces within the transaction up front. You might only have one trace out of 5 (or 1,000). So, if you were to use this scheme to order 3/5 traces, then insert the remaining 2, the order should still work as expected without needing to update the first 3.
  • Ideally, the scheme would determine a value for each trace that can be used in a SQL ORDER BY clause. The value could be of any data type - integer, float, text (e.g. sorted lexicographically), or something more exotic.

Background

Here's an example of a trace_filter request and response ([Alchemy sandbox link](https://sandbox.alchemy.com/?network=ETH_MAINNET&method=trace_filter&body.id=1&body.jsonrpc=2.0&body.method=trace_filter&body.params%5B0%5D.fromBlock=0xc26f54&body.params%5B0%5D.toBlock=0xc26f54&body.params%5B0%5D.toAddress%5B0%5D=0x000000000000abe945c436595ce765a8a261317b&

@0xOlias
0xOlias / index.ts
Created June 4, 2024 14:41
Dune script
import {
QueryParameter,
DuneClient,
QueryEngine,
type ResultsResponse,
} from "@duneanalytics/client-sdk";
type Hex = `0x${string}`;
type LogFilter = {