simulates MEV activity from an array of unique searchers; used for testing infra

Overview

mev-flood

the game

Call bid, placing a bet by setting value, and send the highest bid (which may be in addition to others' bids in the block) before calling claim. The winner (the person who called bid with the highest value this round), upon calling claim gets the entire balance of the contract, at which point highest_bid (also the minimum to land a new bid) resets (to 1 gwei). claim will also only pay out if you placed the most recent bid.

system details

mev-flood system diagram

mev-flood is a multi-daemon project, and is designed to be run in parallel with other instances, each using the same source code but different params.

features

Daemons

  • dumb-searcher: blindly sends bid (constant value) & claim txs on every block
    • mostly fails and wastes money on bids (for others to take)
    • sends to FB builder, may also send to mempool (pending how/what we want to test)
  • smart-searcher: finds winning bid amount and uses a smart contract that atomically executes bid+claim to win the pool
    • if only one instance is run, it's practically guaranteed to win every round
    • if more than one instance is run, they will generate "conflicting" bundles
      • technically all the bundles will land but their profits will be affected by who gets included first
  • 100 test accounts to send from (+1 admin account)
  • claim does not revert when called by a non-winner (on purpose, to add technical complexity to the game)

Scripts

  • createWallets: creates new wallets.json file populated w/ 100 wallets
  • fundWallets: send 0.1 ETH to each wallet in wallets.json from admin wallet (defined by env ADMIN_PRIVATE_KEY)

setup

yarn install

# pick your poison:
cp .env.example .env.goerli
cp .env.example .env.sepolia

vim .env.goerli
vim .env.sepolia

Set preferred environment:

export NODE_ENV=sepolia

Generate test accounts:

mkdir src/output
yarn script.createWallets

Fund test accounts (careful, it sends 0.1 ETH to 100 accounts):

yarn script.fundWallets

run

Run dumb-search simulator with 5 accounts (careful, it currently sends to mempool without checking for profit):

yarn dumb-dev 0 5

Note: 5 is the exclusive end index, meaning that arguments (0 5) will use wallets[0, 1, 2, 3, 4].

Run smart-search simulator.

yarn smart-dev

production

yarn build
yarn dumb-search $i $j
yarn smart-search

mempool testing

You might need to use the mempool to test your transactions' validity before trying to use the bundle API.

yarn dumb-dev 13 14 mempool

stress-test example

Run 49 dumb searchers and 2 smart searchers (a relatively realistic case):

# terminal 1 (49 test wallets)
yarn dumb-dev 0 49

# terminal 2 (49 test wallets)
yarn dumb-dev 49 98

# terminal 3 (2 test wallets)
yarn smart-dev 98 100

other features

Get bundle stats:

yarn script.getBundleStats 0x40d83aebb63f61730eb6309e1a806624cf6d52ff666d1b13d5ced535397f9a46 0x7088e9
# alternatively you can use int block number
yarn script.getBundleStats 0x40d83aebb63f61730eb6309e1a806624cf6d52ff666d1b13d5ced535397f9a46 7375081

Send private tx: (sends some ETH from adminWallet to itself)

yarn script.sendPrivateTx

Cancel private tx:

yarn script.cancelPrivateTx 0xca79f3114de50a77e42dd595c0ba4e786d3ddf782c62075ec067fe32329e3ea2

Print a test bundle:

yarn script.createTestBundle
You might also like...

Unique guid generator pure Javascript.

Guid Generator Create unique Guids. Usage For client Javascript import { Guid } from "../src/guid"; Guid.NewGuid(); // 1q6G3w1U-8F0D-8p9R-7m6m-5b5B7G

Nov 1, 2022

The vision is for NFTs as unique pages of a PICTURE~BOOK

The vision is for NFTs as unique pages of a PICTURE~BOOK. Where every component is an NFT. Not just the PAGE. Also the TITLE PAGE as a PROMO. The SNDTRACK. So we need a STRUCTURE for this, and a CONTRACT.

Mar 13, 2022

A tiny (108 bytes), secure, URL-friendly, unique string ID generator for JavaScript

A tiny (108 bytes), secure, URL-friendly, unique string ID generator for JavaScript

Nano ID English | Русский | 简体中文 | Bahasa Indonesia A tiny, secure, URL-friendly, unique string ID generator for JavaScript. “An amazing level of sens

Jan 8, 2023

Universally Unique Lexicographically Sortable Identifier

Universally Unique Lexicographically Sortable Identifier

Universally Unique Lexicographically Sortable Identifier UUID can be suboptimal for many uses-cases because: It isn't the most character efficient way

Jan 2, 2023

NFT Art Generator made to create random unique art and their metadeta for NFTS.

NFT Art Generator made to create random unique art and their metadeta for NFTS.

Welcome to HashLips 👄 All the code in these repos was created and explained by HashLips on the main YouTube channel. To find out more please visit: ?

Dec 11, 2022

Master Collection NFT. Mints NFTs on Ethereum containing unique combination of titles for fun.

Master Collection NFT. Mints NFTs on Ethereum containing unique combination of titles for fun.

Master NFT Collection Master NFT Collection is an NFT minting platform that mints NFTs that contain a unique combination of snazzy titles just for fun

Mar 22, 2022

This package generates a unique ID/String for different browsers. Like chrome, Firefox and any other browsers which supports canvas and audio Fingerprinting.

This package generates a unique ID/String for different browsers. Like chrome, Firefox and any other browsers which supports canvas and audio Fingerprinting.

Broprint.js The world's easiest, smallest and powerful visitor identifier for browsers. This package generates a unique ID/String for different browse

Dec 25, 2022

Password Generator - A fast, simple and powerful open-source utility tool for generating strong, unique and random passwords

A fast, simple and powerful open-source utility tool for generating strong, unique and random passwords. Password Generator is free to use as a secure password generator on any computer, phone, or tablet.

Aug 3, 2022

Generate colorful and temporarily identifiable SVGs with unique urls.

Generate colorful and temporarily identifiable SVGs with unique urls.

reptiles.dev Generate colorful and temporarily identifiable SVGs with unique urls.

Dec 6, 2022
Comments
  • uniswapv2 deployoooor

    uniswapv2 deployoooor

    adds script to bootstrap a complete uniswapv2 env

    • 3 DAI clones
    • WETH clone
    • univ2 factory
    • 3 DAI/WETH trading pairs; one for each DAI clone

    yarn script.liquid

    opened by zeroXbrock 0
Owner
brock
eth n stuff
brock
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
A testing focused Remix Stack, that integrates E2E & Unit testing with Playwright, Vitest, MSW and Testing Library. Driven by Prisma ORM. Deploys to Fly.io

Live Demo · Twitter A testing focused Remix Stack, that integrates E2E & Unit testing with Playwright, Vitest, MSW and Testing Library. Driven by Pris

Remix Stacks 18 Oct 31, 2022
A social network that simulates a personal blog, where people post "What's on your mind?". Tweteroo is a Twitter clone.

Tweteroo About A social network that simulates a personal blog, where people post "What's on your mind?". Tweteroo is a Twitter clone. ?? Features ☑️

Luiza Santiago 5 Apr 13, 2022
👕 The project is an E-Commerce called DevShop that simulates a sales site which has men's and women's clothing, jewelry and electronics.

DEVSHOP • E-COMMERCE O projeto é um E-Commerce chamado DevShop que simula um site de vendas a qual possui roupas masculinas, femininas, joalherias e e

Kayke Alves Fujinaka 18 Sep 19, 2022
The project is a To-Do list project to help plan daily, weekly or monthly activity. I used Html, CSS and JavaScript Technology to execute the project.

<<<<<<< HEAD To Do List This project is geared towards applying acguired skills for development of my porfolio through the following practices: Create

Victor Efosa Osagie 6 Dec 19, 2022
This code can be used to log activity on yours Polytoria Games.

polyGameLogger This code can be used to log activity on yours Polytoria Games. current version: 0.1.1 Basic Setup First of all, you need to create a .

Damir Alkhaov 2 Jun 13, 2022
A simple application used to organize your day to day activity. Tasks can be added and removed from this list.

Minimalist ToDo List A minimalist list of TODOs. Built With HTML, CSS, JavaScript Webpack Jest NPM Node Getting Started In order to obtain a local cop

Eva Lavinia Bucur 10 Sep 9, 2022
Javascript-testing-practical-approach-2021-course-v3 - Javascript Testing, a Practical Approach (v3)

Javascript Testing, a Practical Approach Description This is the reference repository with all the contents and the examples of the "Javascript Testin

Stefano Magni 2 Nov 14, 2022
AREX: It is a “Differential Testing” and “Record and Replay Testing” Tool.

AREX: It is a “Differential Testing” and “Record and Replay Testing” Tool. Test restful API by record, replay and stub request/response. Differential

ArexTest 15 Nov 1, 2022