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 / 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
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 / 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()
@Nickforall
Nickforall / ex_abi_multicall.ex
Created January 8, 2022 11:30
Call multicall contract with ExAbi in Elixir
defmodule MyProject.Ethereum.Multicall do
@multicall_addr "0xeefBa1e63905eF1D7ACbA5a8513c70307C1cE441"
@doc """
Takes a list of {address, call} tuples, returns an ok tuple with block number and data in same order as list of calls
iex> MyProject.Ethereum.Multicall.multicall({"0x000", ABI.encode("tokenURI(uint256)", [token_id])})
{:ok, 0x000}
"""
def multicall(list) do

Keybase proof

I hereby claim:

  • I am nickforall on github.
  • I am nickforall (https://keybase.io/nickforall) on keybase.
  • I have a public key whose fingerprint is 421D 6900 A5FF 2F6F 59CC 3549 03D5 2213 0900 BDF2

To claim this, I am signing this object:

name: Elixir CI
on: push
jobs:
build:
runs-on: ubuntu-latest
container:
@Nickforall
Nickforall / config.json
Created July 13, 2017 12:06
This is a demo plugin for what squadbot **could** look like
{
"name": "squadbot-demo",
"commands": {
"demo": "replies \"Yoooo\""
},
"protocols": [
"*"
]
}
@Nickforall
Nickforall / boot.asm
Created March 20, 2017 15:41
Simple kernel entry point
global start
section .multiboot_header
header_start:
dd 0xe85250d6 ; magic number (multiboot 2 spec)
dd 0 ; architecture 0
dd header_end - header_start ; header length
; checksum
dd 0x100000000 - (0xe85250d6 + 0 + (header_end - header_start))
@Nickforall
Nickforall / # php70-mongodb - 2016-11-22_12-52-03.txt
Created November 22, 2016 11:54
php70-mongodb (homebrew/php/php70-mongodb) on macOS 10.11.6 - Homebrew build logs
Homebrew build logs for homebrew/php/php70-mongodb on macOS 10.11.6
Build date: 2016-11-22 12:52:03
#include <LiquidCrystal.h>
LiquidCrystal lcd(10, 11, 2, 3, 4, 5);
String inputString = "";
boolean stringComplete = false;
void setup() {
Serial.begin(9600);
lcd.begin(16, 2);
inputString.reserve(128); //allocate 128 bytes RAM geheugen voor de string