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:

Bot contract:

Bot operator:

Failed tx 1 (block 13710082, index 22):

Frontrun tx 1 (block 13710082, index 0):

Failed tx 2 (block 13710542, index 80):

Frontrun tx 2 (block 13710542, index 0):

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


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


View Github