This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3.10 | |
import asyncio | |
import os.path | |
import sys | |
from asyncio import StreamReader, StreamWriter | |
class PyCat: | |
def __init__(self, host: str, port: int, _loop: asyncio.AbstractEventLoop): | |
self._loop = _loop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import argparse | |
import binascii | |
import hashlib | |
import hmac | |
import struct | |
import web3 | |
from base58 import b58encode_check | |
from ecdsa.curves import SECP256k1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from lib import multicalls | |
import asyncio | |
import nest_asyncio | |
tokens = [ | |
{ | |
"sym": "weth", | |
"address": "0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB", | |
"decimals": 18 | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Factory(NamedTuple): | |
router: str | |
address: str | |
name: str | |
class TokenPair(NamedTuple): | |
token0: str | |
token1: str | |
address: str | |
decimals_0: int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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` |