An experiment to bait a generalized frontrunning MEV bot

Overview

Honeypot 🍯

A simple experiment that:

  • Creates a honeypot contract
  • Baits a generalized fronturnning bot with a unique transaction
  • Analyze bot behaviour using a black box approach

Final project for ChainShort bootcamp Oct 2021 cohort.

Presentation Deck

The project presentation deck is in presentation directory. It gives an overview about the project.

Experiment addresses and txs

Honeypot contract address: 0x1e232d5871979eaa715de2c38381574a9c886bad

Bot contract: 0x31B7e144b2CF261A015004BEE9c84a98263E2F66

Bot operator: 0x0a04e8b4d2014cd2d07a9eaf946945bed1262a99

Failed tx 1 (block 13710082, index 22): 0xcc1172506d5b5fa09cbf66d2296deb24958181f186817eb29cbe8385fd55ed51

Frontrun tx 1 (block 13710082, index 0): 0x18ec2c2e5720c6d332a0f308f8803e834e06c78dcebdc255178891ead56c6d73

Failed tx 2 (block 13710542, index 80): 0xfce9b77a8c7b8544cb699ce646558dc506e030aaba1533c917d7841bcc3f206a

Frontrun tx 2 (block 13710542, index 0): 0x8cda6e76f9a19ce69967d9f74d52402afbafba6ca3469248fe5c9937ef065d47

Running contract tests

The contract tests are written in Solidity. To run them:

  1. Install dapptools on your machine
  2. Navigate to the project root directory in terminal, then dapp install ds-test
  3. Rename .dapprc.template to .dapprc and add your Ethereum RPC endpoint
  4. Use dapp test to run the tests.

PnL dataset

To create or update the PnL dataset:

  1. Make sure you have Python 3 and the relevant modules installed on your machine
  2. Rename config.template.py to config.py and add your Etherscan API key and Alchemy RPC endpoint
  3. Run python analysis/create_pnl_datasets.py in your terminal

Analysis

You can view the analysis files on GitHub. If you want to edit and run them, you need to run Jupyter Notebook server with Anaconda or something similar.

Known limitations

These limitaitons are known by the time of the final presentation:

  • Unoptimized performance and too many JSON-RPC calls in when fetching data
  • PnL computation is based on heuristic, not EVM state changes
  • Outlier detection is based on manual sample check
  • A few hardcoded simplifications like constant token prices
  • No test for pnl.py and calldata.py
Owner
0x1355
Parsing json. Deciphering bytes. And putting it all together again.
0x1355
PyTorch Implementation of CycleGAN and SSGAN for Domain Transfer (Minimal)

MNIST-to-SVHN and SVHN-to-MNIST PyTorch Implementation of CycleGAN and Semi-Supervised GAN for Domain Transfer. Prerequites Python 3.5 PyTorch 0.1.12

Yunjey Choi 401 Dec 30, 2022
Python library for science observations from the James Webb Space Telescope

JWST Calibration Pipeline JWST requires Python 3.7 or above and a C compiler for dependencies. Linux and MacOS platforms are tested and supported. Win

Space Telescope Science Institute 386 Dec 30, 2022
Code release for NeX: Real-time View Synthesis with Neural Basis Expansion

NeX: Real-time View Synthesis with Neural Basis Expansion Project Page | Video | Paper | COLAB | Shiny Dataset We present NeX, a new approach to novel

538 Jan 09, 2023
Collection of Docker images for ML/DL and video processing projects

Collection of Docker images for ML/DL and video processing projects. Overview of images Three types of images differ by tag postfix: base: Python with

OSAI 87 Nov 22, 2022
A small library for creating and manipulating custom JAX Pytree classes

Treeo A small library for creating and manipulating custom JAX Pytree classes Light-weight: has no dependencies other than jax. Compatible: Treeo Tree

Cristian Garcia 58 Nov 23, 2022
Hashformers is a framework for hashtag segmentation with transformers.

Hashtag segmentation is the task of automatically inserting the missing spaces between the words in a hashtag. Hashformers applies Transformer models

Ruan Chaves 41 Nov 09, 2022
Official implementation of Rich Semantics Improve Few-Shot Learning (BMVC, 2021)

Rich Semantics Improve Few-Shot Learning Paper Link Abstract : Human learning benefits from multi-modal inputs that often appear as rich semantics (e.

Mohamed Afham 11 Jul 26, 2022
Matching python environment code for Lux AI 2021 Kaggle competition, and a gym interface for RL models.

Lux AI 2021 python game engine and gym This is a replica of the Lux AI 2021 game ported directly over to python. It also sets up a classic Reinforceme

Geoff McDonald 74 Nov 03, 2022
An Unbiased Learning To Rank Algorithms (ULTRA) toolbox

Unbiased Learning to Rank Algorithms (ULTRA) This is an Unbiased Learning To Rank Algorithms (ULTRA) toolbox, which provides a codebase for experiment

back 3 Nov 18, 2022
Volumetric Correspondence Networks for Optical Flow, NeurIPS 2019.

VCN: Volumetric correspondence networks for optical flow [project website] Requirements python 3.6 pytorch 1.1.0-1.3.0 pytorch correlation module (opt

Gengshan Yang 144 Dec 06, 2022
Continual reinforcement learning baselines: experiment specifications, implementation of existing methods, and common metrics. Easily extensible to new methods.

Continual Reinforcement Learning This repository provides a simple way to run continual reinforcement learning experiments in PyTorch, including evalu

55 Dec 24, 2022
NeuralForecast is a Python library for time series forecasting with deep learning models

NeuralForecast is a Python library for time series forecasting with deep learning models. It includes benchmark datasets, data-loading utilities, evaluation functions, statistical tests, univariate m

Nixtla 1.1k Jan 03, 2023
Dimension Reduced Turbulent Flow Data From Deep Vector Quantizers

Dimension Reduced Turbulent Flow Data From Deep Vector Quantizers This is an implementation of A Physics-Informed Vector Quantized Autoencoder for Dat

DreamSoul 3 Sep 12, 2022
[CVPR'21] DeepSurfels: Learning Online Appearance Fusion

DeepSurfels: Learning Online Appearance Fusion Paper | Video | Project Page This is the official implementation of the CVPR 2021 submission DeepSurfel

Online Reconstruction 52 Nov 14, 2022
Official code for On Path Integration of Grid Cells: Group Representation and Isotropic Scaling (NeurIPS 2021)

On Path Integration of Grid Cells: Group Representation and Isotropic Scaling This repo contains the official implementation for the paper On Path Int

Ruiqi Gao 39 Nov 10, 2022
All public open-source implementations of convnets benchmarks

convnet-benchmarks Easy benchmarking of all public open-source implementations of convnets. A summary is provided in the section below. Machine: 6-cor

Soumith Chintala 2.7k Dec 30, 2022
PyTorch implemention of ICCV'21 paper SGPA: Structure-Guided Prior Adaptation for Category-Level 6D Object Pose Estimation

SGPA: Structure-Guided Prior Adaptation for Category-Level 6D Object Pose Estimation This is the PyTorch implemention of ICCV'21 paper SGPA: Structure

Chen Kai 24 Dec 05, 2022
Forecasting with Gradient Boosted Time Series Decomposition

ThymeBoost ThymeBoost combines time series decomposition with gradient boosting to provide a flexible mix-and-match time series framework for spicy fo

131 Jan 08, 2023
This is a Python Module For Encryption, Hashing And Other stuff

EnroCrypt This is a Python Module For Encryption, Hashing And Other Basic Stuff You Need, With Secure Encryption And Strong Salted Hashing You Can Do

5 Sep 15, 2022
Official implementation of "Dynamic Anchor Learning for Arbitrary-Oriented Object Detection" (AAAI2021).

DAL This project hosts the official implementation for our AAAI 2021 paper: Dynamic Anchor Learning for Arbitrary-Oriented Object Detection [arxiv] [c

ming71 215 Nov 28, 2022