Skip to content

Instantly share code, notes, and snippets.

Avatar

Darkerego darkerego

View GitHub Profile
@darkerego
darkerego / crash_aurora.py
Last active Jan 24, 2023
Crash Aurora Node
View crash_aurora.py
# from lib import multicalls
import asyncio
import nest_asyncio
tokens = [
{
"sym": "weth",
"address": "0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB",
"decimals": 18
},
@darkerego
darkerego / get_dex_arb_config.py
Created Jan 19, 2023
Enumerating all the token pairs
View get_dex_arb_config.py
class DexLoader:
def dump(self, obj, path):
with open(path, 'w') as f:
json.dump(obj, f)
def load(self, path):
with open(path, 'r') as f:
_dex = Dex(**json.load(f))
return _dex
@darkerego
darkerego / Enumerating Token Pairs
Created Jan 19, 2023
Enumerating all the token pairs
View Enumerating Token Pairs
class DexLoader:
def dump(self, obj, path):
with open(path, 'w') as f:
json.dump(obj, f)
def load(self, path):
with open(path, 'r') as f:
_dex = Dex(**json.load(f))
return _dex
@darkerego
darkerego / rescalc.py
Last active Jan 19, 2023
Price Calculation From Reserves
View rescalc.py
class Factory(NamedTuple):
router: str
address: str
name: str
class TokenPair(NamedTuple):
token0: str
token1: str
address: str
decimals_0: int
@darkerego
darkerego / flasharb.sol
Created Jan 18, 2023
Solidity Flash Arbitrage
View flasharb.sol
// File: @openzeppelin/contracts/utils/Context.sol
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
View gist:57adf22ac8a49d3af1410c9f3d8f2d1c
# import into python shell for fast debug/testing
import web3
from web3.middleware import geth_poa_middleware
from lib import abi_lib
from dotenv import load_dotenv
from os import environ
aurora_ws_endpoint = 'wss://ws-nd-569-292-463.p2pify.com/ad55a63e553ce9ec001717f4d816eb0e'
aurora__flash_arbitrage_contract = '0x61a989372fEac262d2b630eD171373ee95517db6'
from_addr='0x6126315AEac95BAA46C8e257509F9D4d63777b61'
priv_key=None
View gist:331ed9616653f195f485191bb3e20a85
#!/usr/bin/env bash
echo "Updating the system ... "
apt-get -y update
echo "Installing the packages ... "
apt-get -y install dnscrypt-proxy dnsutils net-tools
cat << _EOF_ >> /etc/dnscrypt-proxy/dnscrypt-proxy.toml
# Empty listen_addresses to use systemd socket activation
@darkerego
darkerego / start.sh
Created Dec 10, 2022
Protonchain startup script
View start.sh
#!/bin/sh
ulimit -a
DATADIR="/var/lib/nodeos"
CONFIGDIR="/etc/nodeos"
COMMAND="/usr/bin/nodeos --config-dir $CONFIGDIR -d $DATADIR"
if [ -e $DATADIR/snapshots ]
then
SNAPSHOT=`ls $DATADIR/snapshots/ | head -1`
@darkerego
darkerego / ethkeyscan.py
Last active Nov 28, 2022
Etherum Keyscanner
View ethkeyscan.py
import argparse
# modified fetch function with semaphore
import asyncio
import json
import pprint
import logging
import aiofiles
import aiohttp
from web3 import Web3, HTTPProvider
import os
@darkerego
darkerego / function_helpers.py
Created Jun 4, 2022
Python Function Helpers
View function_helpers.py
import asyncio
import threading
import time
from concurrent.futures import ThreadPoolExecutor
from typing import List, Any
class AsyncThreadPool(ThreadPoolExecutor):
_futures: List[asyncio.Future]
_loop: asyncio.AbstractEventLoop