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
Deep Learning agent of Starcraft2, similar to AlphaStar of DeepMind except size of network.

Introduction This repository is for Deep Learning agent of Starcraft2. It is very similar to AlphaStar of DeepMind except size of network. I only test

Dohyeong Kim 136 Jan 04, 2023
Sound and Cost-effective Fuzzing of Stripped Binaries by Incremental and Stochastic Rewriting

StochFuzz: A New Solution for Binary-only Fuzzing StochFuzz is a (probabilistically) sound and cost-effective fuzzing technique for stripped binaries.

Zhuo Zhang 164 Dec 05, 2022
The official implementation of CSG-Stump: A Learning Friendly CSG-Like Representation for Interpretable Shape Parsing

CSGStumpNet The official implementation of CSG-Stump: A Learning Friendly CSG-Like Representation for Interpretable Shape Parsing Paper | Project page

Daxuan 39 Dec 26, 2022
the code for paper "Energy-Based Open-World Uncertainty Modeling for Confidence Calibration"

EOW-Softmax This code is for the paper "Energy-Based Open-World Uncertainty Modeling for Confidence Calibration". Accepted by ICCV21. Usage Commnd exa

Yezhen Wang 36 Dec 02, 2022
Implementation of CrossViT: Cross-Attention Multi-Scale Vision Transformer for Image Classification

CrossViT : Cross-Attention Multi-Scale Vision Transformer for Image Classification This is an unofficial PyTorch implementation of CrossViT: Cross-Att

Rishikesh (ऋषिकेश) 103 Nov 25, 2022
NeuroFind - A solution to the to the Task given by the Oberseminar of Messtechnik Institute of TU Dresden in 2021

NeuroFind A solution to the to the Task given by the Oberseminar of Messtechnik

1 Jan 20, 2022
Official implementation of UTNet: A Hybrid Transformer Architecture for Medical Image Segmentation

UTNet (Accepted at MICCAI 2021) Official implementation of UTNet: A Hybrid Transformer Architecture for Medical Image Segmentation Introduction Transf

110 Jan 01, 2023
Video-face-extractor - Video face extractor with Python

Python face extractor Setup Create the srcvideos and faces directories Put your

2 Feb 03, 2022
ConE: Cone Embeddings for Multi-Hop Reasoning over Knowledge Graphs

ConE: Cone Embeddings for Multi-Hop Reasoning over Knowledge Graphs This is the code of paper ConE: Cone Embeddings for Multi-Hop Reasoning over Knowl

MIRA Lab 33 Dec 07, 2022
A curated list and survey of awesome Vision Transformers.

English | 简体中文 A curated list and survey of awesome Vision Transformers. You can use mind mapping software to open the mind mapping source file. You c

OpenMMLab 281 Dec 21, 2022
Neural Re-rendering for Full-frame Video Stabilization

NeRViS: Neural Re-rendering for Full-frame Video Stabilization Project Page | Video | Paper | Google Colab Setup Setup environment for [Yu and Ramamoo

Yu-Lun Liu 9 Jun 17, 2022
Dataset VSD4K includes 6 popular categories: game, sport, dance, vlog, interview and city.

CaFM-pytorch ICCV ACCEPT Introduction of dataset VSD4K Our dataset VSD4K includes 6 popular categories: game, sport, dance, vlog, interview and city.

96 Jul 05, 2022
Predicting Price of house by considering ,house age, Distance from public transport

House-Price-Prediction Predicting Price of house by considering ,house age, Distance from public transport, No of convenient stores around house etc..

Musab Jaleel 1 Jan 08, 2022
Adversarial Self-Defense for Cycle-Consistent GANs

Adversarial Self-Defense for Cycle-Consistent GANs This is the official implementation of the CycleGAN robust to self-adversarial attacks used in pape

Dina Bashkirova 10 Oct 10, 2022
Code release for Convolutional Two-Stream Network Fusion for Video Action Recognition

Convolutional Two-Stream Network Fusion for Video Action Recognition

Christoph Feichtenhofer 676 Dec 31, 2022
Notspot robot simulation - Python version

Notspot robot simulation - Python version This repository contains all the files and code needed to simulate the notspot quadrupedal robot using Gazeb

50 Sep 26, 2022
This is the source code of the solver used to compete in the International Timetabling Competition 2019.

ITC2019 Solver This is the source code of the solver used to compete in the International Timetabling Competition 2019. Building .NET Core (2.1 or hig

Edon Gashi 8 Jan 22, 2022
DSEE: Dually Sparsity-embedded Efficient Tuning of Pre-trained Language Models

DSEE Codes for [Preprint] DSEE: Dually Sparsity-embedded Efficient Tuning of Pre-trained Language Models Xuxi Chen, Tianlong Chen, Yu Cheng, Weizhu Ch

VITA 4 Dec 27, 2021
Code for the bachelors-thesis flaky fault localization

Flaky_Fault_Localization Scripts for the Bachelors-Thesis: "Flaky Fault Localization" by Christian Kasberger. The thesis examines the usefulness of sp

Christian Kasberger 1 Oct 26, 2021