Skip to content

Instantly share code, notes, and snippets.

View Nickforall's full-sized avatar
🅱️
come work with us @basementdev :)

Nick Vernij Nickforall

🅱️
come work with us @basementdev :)
View GitHub Profile
@Nickforall
Nickforall / aws_managed_blockchain.ex
Created January 8, 2022 18:37
Aws Managed Blockchain node for ethereumex
defmodule MyProject.Ethereum.AwsNode do
use Ethereumex.Client.BaseClient
alias Ethereumex.Config
@type opt :: {:url, String.t()}
@type empty_response :: :empty_response
@type invalid_json :: {:invalid_json, any()}
@type http_client_error :: {:error, empty_response() | invalid_json() | any()}
@spec post_request(binary(), [opt()]) :: {:ok, any()} | http_client_error()
SELECT
transaction_hash,
topics [SAFE_OFFSET(1)] AS from_address,
topics [SAFE_OFFSET(2)] AS to_address,
address AS contract
FROM
`bigquery-public-data.crypto_ethereum.logs`
WHERE
topics [SAFE_OFFSET(0)] = "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0"
AND DATE(block_timestamp) = "2022-08-12"
@Nickforall
Nickforall / nounish_vote_stats.sql
Created July 9, 2023 19:57
Nouns stats on basement.dev
WITH votes as (
SELECT
tl.topic1 as voter_address,
-- data is non dynamic for CastVote, so we can safely slice the uint8 out.
substring(tl.data, 64, 1) as support,
tl.block_number as block_number
FROM
transaction_log AS tl
WHERE
-- CAST VOTE LOG