Skip to content

Instantly share code, notes, and snippets.

View bh2smith's full-sized avatar
🤘

Benjamin Smith bh2smith

🤘
View GitHub Profile
@bh2smith
bh2smith / blocks.sh
Last active March 1, 2024 11:35
BlockTimes.sh
#!/bin/bash
# Space separated Array of Ethereum block numbers to fetch timestamps for
blockNumbers=(18562256 18562257)
ethRpc="https://rpc.ankr.com/eth"
for blockNumber in "${blockNumbers[@]}"
do
data="{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockByNumber\",\"params\":[\"0x$(printf '%x\n' $blockNumber)\", false],\"id\":1}"
@bh2smith
bh2smith / run_arak.md
Last active September 18, 2023 19:07
Run Arak Quickstart

Arak Quickstart

Arak is a very simple ethereum log indexing program found on github at: https://github.com/cowprotocol/arak

Create Postgres Instance

docker pull postgres

docker run --name erc721 -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=postgres -d postgres
@bh2smith
bh2smith / EVM.RPC.Examples.md
Last active July 5, 2023 18:25
Elementary EVM RPC Requests

Curl Requests made as follows JSON files will be provided per section

 export ARCHIVE_NODE_URL=
 export JSON_FILE_PATH=
curl $ARCHIVE_NODE_URL -X POST -H "Content-Type: application/json" --data $JSON_FILE_PATH | jq
@bh2smith
bh2smith / internal_batches.md
Created January 13, 2023 12:50
Orderbook Uninternalized Batches
with solutions as (
  select 
    (json -> 'solutions' ->> -1)::jsonb as winning_solution
  from solver_competitions
  where id >= 4929771  -- The first batch containing the field `uninternalizedCallData`
)

select 100.0 * sum(case when winning_solution -> 'uninternalizedCallData' is null then 1 else 0 end) / count(*) as proportion_uninternalized
from solutions
@bh2smith
bh2smith / CommunityTableSchema.sql
Last active December 12, 2022 11:51
Dune Community Sources Schema
-- Dune Query for relevant views (postgres): https://dune.com/queries/1582621
-- Below is a HiveSQL (pseudo code) schema with corresponding postgres types:
-- TABLE 1: Order Rewards
-- Update schedule: hourly
-- Size: Currently 20k records this table will have approximately the same dimensions as number of trades on cow_prococol.
-- The first three columns are on-chain verifyable,
-- the json data field contains data from our orderbook DB.

0x064523df9bf2d9b907f20bbec50150d2ddd5721e66bd751c1f42447e96421bab

@bh2smith
bh2smith / watch_brackets_xdai.tsv
Last active February 17, 2021 09:31
xDAI List of OWL Liquidity Providing CMM brackets
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 3 columns, instead of 2. in line 2.
alias brackets threshold
xdai_OWL_USDT 0x404475124bFD465c93e6E501a2E2EAbf19342217,0x9335e92c0FFC2462f595b8734C5F2A2d4DC8fF60,0x3EAeaEe2abE3Edc3aef95Dc962b13B92F4a38Bf5,0x0ed697D48fedBEe30776877aeA74d94FC46aC253,0x2890b0677D46826F7eA60840bA260ecE12eAB51D,0xE7158521c598d721F534718303937747351Fab08,0x568ab74a3226011922F0f10daFEdA561971923E1,0x8ec7FB2ff9b5E8DE165700d55f14329513Fb09c9,0xE478865547C7eA6a31730914696aF66F4FBDf417,0x2D8EAC7Fb9B39d48f30f602240484Be9448719B8 1
xdai_OWL_STAKE 0xF3960C7705D25907F81999bd3B31EB4e18105927,0xF5B40dd9cEB22d14c06bd1Ea59C1769c8D276521,0x2a35C901E5d03b71DC0ab8F38b331B8c38869E96,0x311be2B3905A0eD8E921FeE755A7981700418067,0x1f3bb2B6afF5aAE967AfdcC9479c33E0f5a1d19c,0xFC238F174fd1f6cc55691D18eB6510574ECd745F,0x7553244AFA2a33Fe1A6Ac22B985862881A52ee76,0x9AC1607e36df821D7A594cB9fb4f73454693bA03,0xF888243aacb5626b520D0028371baD672a477Fd8,0xC2D9C507c40F7fb9dCEf6e7223d2AAaBddCE9A12,0x4ab8b6D38E99F262bC8E7D0C212183B1AE397467,0x83FF7c9A5269840fe978258e009177b014AC5A4e,0x2Ec14A40294223555CEc
alias brackets threshold
mainnet_OWL_USDC 0x4a908f815303023df30242376973e833acf434d0 10000
@bh2smith
bh2smith / clippy_warnings.txt
Created April 27, 2019 07:28
Cargo Clippy on Driver
warning: long literal lacking separators
--> src/contract.rs:227:43
|
227 | options.gas = Some(U256::from(5000000));
| ^^^^^^^ help: consider: `5_000_000`
|
= note: #[warn(clippy::unreadable_literal)] on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unreadable_literal
warning: unneeded return statement
Verifying my identity on Peepeth.com 0x7f01d9b227593e033bf8d6fc86e634d27aa85568