Skip to content

Instantly share code, notes, and snippets.

View raddy's full-sized avatar

Rad raddy

  • Lagrange 3
View GitHub Profile
@raddy
raddy / withdrawooors.txt
Created October 8, 2022 21:22
Celsius Last Month Withdrawooooors
name amount_usd
HOME 007 LLC 27046213.31
BRADLEY JAMES DOWNS 19073892.84
NICHOLAS FARR 14450000.0
ANDREW YOON 10975222.41
CRYPTO10 SP -SEGREGATED PORTFOLIO OF INVICTUS CAPITAL FINANCIAL TECHNOLOGIES SPC 8024189.72
R. WOLSTENHOLME 7925324.27
DARRYL THOMAS ADAMS 4250406.0600000005
KEVIN JAY WEXLER 3655891.6500000004
KEVIN RAY FARPELLA 2904686.01
@raddy
raddy / fetchQuotes.js
Created September 8, 2022 19:48
Example fetching multicall
const { ethers } = require("ethers");
const { program } = require("commander");
const { formatUnits } = require("@ethersproject/units");
const quoterABI = require("./quoter.json");
const erc20Abi = require("./erc20.json");
const config = require('config');
const {Multicall, ContractCallContext} = require("ethereum-multicall");
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/epoll.h>
#include <fcntl.h>
#include <thread>
#include <cstring>
#include <iostream>
#include <unistd.h>
@raddy
raddy / slot.js
Created June 25, 2022 16:22
Fetch allowances slot
#!/usr/bin/env node
const { ethers } = require("ethers");
const { formatUnits } = require("@ethersproject/units");
const { program } = require("commander");
const erc20Abi = require("./erc20.json");
const storage = async (
provider,
tokenAddress,
@raddy
raddy / fetch_logs.js
Last active June 22, 2022 02:46
Fetch logs from graphql endpoint
const { ethers, utils } = require("ethers");
const { request, gql } = require("graphql-request");
const { program } = require("commander");
const query = gql`
query blockLogs($start : Long, $end : Long, $addresses : [Address!], $topics: [[Bytes32!]!]) {
logs(filter: {fromBlock: $start, toBlock: $end, addresses: $addresses, topics: $topics}) {
account {
address
}
@raddy
raddy / wip.py
Created April 18, 2022 16:11
WiP on UniV2 arb finding
from dataclasses import dataclass
from dataclasses_json import dataclass_json
from abc import ABC, abstractmethod
from typing import List
from scipy import optimize
class Pool(ABC):
@abstractmethod
def amount_out(self, token_in : str, token_out : str, amount_in : int) -> int:
pass
@raddy
raddy / fetchApprovals.js
Created April 3, 2022 22:59
Fetch anyone whoever approved a token to an address
const { program } = require("commander");
const fetch = require('node-fetch');
//const fs = require('fs');
//const outFile = "users.txt";
const urlRoot = 'https://api.etherscan.io/api?module=logs&action=getLogs&';
const fetchApprovals = async (
startBlock,
token,
@raddy
raddy / whatSlot.js
Created April 3, 2022 15:12
Find allowances slot in an ERC20
#!/usr/bin/env node
const { ethers } = require("ethers");
const { formatUnits } = require("@ethersproject/units");
const { program } = require("commander");
const erc20Abi = require("./erc20.json");
const storage = async (
provider,
tokenAddress,
@raddy
raddy / 4bytes.py
Created January 12, 2022 16:21
grep out push4 opcodes
import sys
from pyevmasm import disassemble_hex
def four_byte(line):
toks = line.split()
if toks[0] != 'PUSH4':
return
return toks[1]
def main():
@raddy
raddy / check_ctor_args.py
Created January 10, 2022 00:18
checks the ctor bytes vs known addies
import sys
import json
def etherscan_link(addy : str):
return f"https://etherscan.io/address/{addy}"
def formatted_addy(addy : str):
l = etherscan_link(addy)
return f"[{addy}]({l})"