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
You might also like...
An official implementation of "Exploiting a Joint Embedding Space for Generalized Zero-Shot Semantic Segmentation" (ICCV 2021) in PyTorch.

Exploiting a Joint Embedding Space for Generalized Zero-Shot Semantic Segmentation This is an official implementation of the paper "Exploiting a Joint

GeDML is an easy-to-use generalized deep metric learning library
GeDML is an easy-to-use generalized deep metric learning library

GeDML is an easy-to-use generalized deep metric learning library

Learnable Multi-level Frequency Decomposition and Hierarchical Attention Mechanism for Generalized Face Presentation Attack Detection
Learnable Multi-level Frequency Decomposition and Hierarchical Attention Mechanism for Generalized Face Presentation Attack Detection

LMFD-PAD Note This is the official repository of the paper: LMFD-PAD: Learnable Multi-level Frequency Decomposition and Hierarchical Attention Mechani

 Audio-Visual Generalized Few-Shot Learning with Prototype-Based Co-Adaptation
Audio-Visual Generalized Few-Shot Learning with Prototype-Based Co-Adaptation

Audio-Visual Generalized Few-Shot Learning with Prototype-Based Co-Adaptation The code repository for "Audio-Visual Generalized Few-Shot Learning with

Generalized hybrid model for mode-locked laser diodes with an extended passive cavity

GenHybridMLLmodel Generalized hybrid model for mode-locked laser diodes with an extended passive cavity This hybrid simulation strategy combines a tra

Generalized Jensen-Shannon Divergence Loss for Learning with Noisy Labels

The official code for the NeurIPS 2021 paper Generalized Jensen-Shannon Divergence Loss for Learning with Noisy Labels

Learning hidden low dimensional dyanmics using a Generalized Onsager Principle and neural networks

OnsagerNet Learning hidden low dimensional dyanmics using a Generalized Onsager Principle and neural networks This is the original pyTorch implemenati

Official implementation of Generalized Data Weighting via Class-level Gradient Manipulation (NeurIPS 2021).
Official implementation of Generalized Data Weighting via Class-level Gradient Manipulation (NeurIPS 2021).

Generalized Data Weighting via Class-level Gradient Manipulation This repository is the official implementation of Generalized Data Weighting via Clas

Generalized Decision Transformer for Offline Hindsight Information Matching

Generalized Decision Transformer for Offline Hindsight Information Matching [arxiv] If you use this codebase for your research, please cite the paper:

Owner
0x1355
Parsing json. Deciphering bytes. And putting it all together again.
0x1355
QuickAI is a Python library that makes it extremely easy to experiment with state-of-the-art Machine Learning models.

QuickAI is a Python library that makes it extremely easy to experiment with state-of-the-art Machine Learning models.

null 152 Jan 2, 2023
Experiment about Deep Person Re-identification with EfficientNet-v2

We evaluated the baseline with Resnet50 and Efficienet-v2 without using pretrained models. Also Resnet50-IBN-A and Efficientnet-v2 using pretrained on ImageNet. We used two datasets: Market-1501 and CUHK03.

lan.nguyen2k 77 Jan 3, 2023
Calling Julia from Python - an experiment on data loading

Calling Julia from Python - an experiment on data loading See the slides. TLDR After reading Patrick's blog post, we decided to try to replace C++ wit

Abel Siqueira 8 Jun 7, 2022
A practical ML pipeline for data labeling with experiment tracking using DVC.

Auto Label Pipeline A practical ML pipeline for data labeling with experiment tracking using DVC Goals: Demonstrate reproducible ML Use DVC to build a

Todd Cook 4 Mar 8, 2022
Small-bets - Ergodic Experiment With Python

Ergodic Experiment Based on this video. Run this experiment with this command: p

Michael Brant 3 Jan 11, 2022
An experiment on the performance of homemade Q-learning AIs in Agar.io depending on their state representation and available actions

Agar.io_Q-Learning_AI An experiment on the performance of homemade Q-learning AIs in Agar.io depending on their state representation and available act

null 1 Jun 9, 2022
This is the source code for our ICLR2021 paper: Adaptive Universal Generalized PageRank Graph Neural Network.

GPRGNN This is the source code for our ICLR2021 paper: Adaptive Universal Generalized PageRank Graph Neural Network. Hidden state feature extraction i

Jianhao 92 Jan 3, 2023
A generalized framework for prototyping full-stack cooperative driving automation applications under CARLA+SUMO.

OpenCDA OpenCDA is a SIMULATION tool integrated with a prototype cooperative driving automation (CDA; see SAE J3216) pipeline as well as regular autom

UCLA Mobility Lab 726 Dec 29, 2022
code for ICCV 2021 paper 'Generalized Source-free Domain Adaptation'

G-SFDA Code (based on pytorch 1.3) for our ICCV 2021 paper 'Generalized Source-free Domain Adaptation'. [project] [paper]. Dataset preparing Download

Shiqi Yang 84 Dec 26, 2022