Git Product home page Git Product logo

flashbot's Introduction

Flashbot recovery example

  • The problem: One of your wallets has been compromised, and any ETH you put on ther is siphoned off immediately. You would like to retrieve some assets or transfer contract ownership, but that all costs gas and your gas tank is stuck on empty.
  • The solution: Flashbots!
  • The code for this repo provides an example of how
  • This is the actual code I used (with added comments) to recover assets from a compromised wallet
  • Most of the code comes from the original repository

Preparations

  1. Run npm install
  2. Create an account at a node service provider: Infura is used in this example.
  3. Construct a list of transactions. You can get the gasLimit and tx data by doing a dry run with metamask and/or etherscan
  4. Test out on Goerli testnet (if possible)
  5. Prepare a mainnet wallet which has just enough Ethers for the bundle, and no other assets

Running the script

Linux / Mac users

Pass everything in as environment variables, like so:

  • INFURA_KEY=<...> FUNDING_WALLET_PRIVATE_KEY=<...> COMPROMISED_WALLET_PRIVATE_KEY=<...> npm run start. Remember
  • For example: INFURA_KEY='blah' FUNDING_WALLET_PRIVATE_KEY='abc' COMPROMISED_WALLET_PRIVATE_KEY='def' npm run start

Windows users

Either modify the script to use the dotenv package or carefully insert the data manually in the script. NEVER EVER UPLOAD THE SCRIPT WITH THE PRIVATE DATA ANYWHERE ONLINE

flashbot's People

Contributors

laurizure avatar scyclow avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.