{"id":20433905,"url":"https://github.com/flashbots/searcher-sponsored-tx","last_synced_at":"2025-04-05T09:07:46.683Z","repository":{"id":40781743,"uuid":"344029256","full_name":"flashbots/searcher-sponsored-tx","owner":"flashbots","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-15T01:11:49.000Z","size":107,"stargazers_count":383,"open_issues_count":16,"forks_count":160,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-03-29T08:08:00.755Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flashbots.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-03T06:45:31.000Z","updated_at":"2025-03-18T13:54:58.000Z","dependencies_parsed_at":"2023-02-09T20:50:12.729Z","dependency_job_id":null,"html_url":"https://github.com/flashbots/searcher-sponsored-tx","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fsearcher-sponsored-tx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fsearcher-sponsored-tx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fsearcher-sponsored-tx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fsearcher-sponsored-tx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flashbots","download_url":"https://codeload.github.com/flashbots/searcher-sponsored-tx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247312078,"owners_count":20918344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T08:22:19.725Z","updated_at":"2025-04-05T09:07:46.639Z","avatar_url":"https://github.com/flashbots.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"searcher-sponsored-tx\n=======================\nThis repository contains a simple Flashbots \"searcher\" for submitting a transaction from an `executor` account, but paying for the transaction from a `sponsor` account. This is accomplished by submitting a Flashbots transaction bundle, with the first \"sponsor\" transaction paying the \"executor\" wallet in ETH, followed by a series of `executor` transactions that spend this newly received ETH on gas fees.\n\nWe hope you will use this repository as an example of how to integrate Flashbots into your own Flashbot searcher (bot). For more information, see the [Flashbots Searcher Quick Start](https://docs.flashbots.net/flashbots-auction/searchers/quick-start/)\n\nUse case\n========\nThe use case for this multi-transaction setup is to make calls from an account that has a compromised private key. Since transferring in any ETH to this compromised wallet will immediately be swept by bots that monitor that account, transferring in funds will also give any attacker the ability to withdraw tokens that are held by that account.\n\nUsing this searcher, you can create a bundle of transaction that execute against the compromised account, spending ETH that was received in the same block.\n\nWith the activation of EIP-1559, the old method of using `gasPrice = 0` is no longer functional. Transactions must pay at least `baseFee`.\n\n\nEnvironment Variables\n=====================\n- ETHEREUM_RPC_URL - Ethereum RPC endpoint. Can not be the same as FLASHBOTS_RPC_URL\n- PRIVATE_KEY_EXECUTOR - Private key for the compromised Ethereum EOA that owns assets that needs to be transferred\n- PRIVATE_KEY_SPONSOR - Private key for an account that has ETH that will be used to fund the miner for the \"ZERO_GAS\" transactions \n- RECIPIENT - Ethereum EOA to receive assets from ZERO_GAS account\n- FLASHBOTS_RELAY_SIGNING_KEY - Optional param, private key used to sign messages to Flashbots to establish reputation of profitability\n\nSetting Miner Reward\n====================\nInside `src/index.ts` is :\n```\nconst PRIORITY_GAS_PRICE = GWEI.mul(31)\n```\n\nThis is the priority fee, on top of baseFee, sent to the miner for *all* transactions in the bundle, including the sponsor-funding transaction. All transactions use the same gasPrice, with no coinbase transfers in any transaction. In the case of a block re-organization, hopefully all transactions will appear in the next block as well, preventing sweeper bots from gaining access to the incoming ETH before it is spent on gas fees.\n\nSelecting a different \"engine\"\n==============================\nThis system can operate against different protocols by swapping a new \"engine\" class that adheres to \"Base\" functionality in the `main()` function. Available engines:\n- `TransferERC20`\n- `CryptoKitties`\n- `Approval721`\n  \n\nAn engine accepts relevant parameters during construction and provides functions to retrieve transaction descriptions to be passed in to Flashbots. Selecting and configuring a different engine requires directly modifying the source, uncommenting the engine and setting the necessary variables.\n\n\nUsage\n======================\n```\n$ npm install\n$ PRIVATE_KEY_EXECUTOR=__COMPROMISED_PRIVATE_KEY__ \\\n    PRIVATE_KEY_SPONSOR=__FUNDED_PRIVATE_KEY__ \\\n    RECIPIENT=__ADDRESS_THAT_RECEIVES_ASSETS__ \\\n    FLASHBOTS_SECRET=__YOUR_PERSONAL_SECRET__ \\\n      npm run start\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflashbots%2Fsearcher-sponsored-tx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflashbots%2Fsearcher-sponsored-tx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflashbots%2Fsearcher-sponsored-tx/lists"}